Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdc7c89

Browse files
committed
Minor polishing work, fixing typos and grammar in the faq.
1 parent f191ae5 commit fdc7c89

3 files changed

Lines changed: 54 additions & 42 deletions

File tree

doc/faq/howto_faq.rst

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Plotting: howto
1515

1616
.. _howto-findobj:
1717

18-
Find all objects in figure of a certain type
19-
-------------------------------------------------------------
18+
Find all objects in a figure of a certain type
19+
----------------------------------------------
2020

2121
Every matplotlib artist (see :ref:`artist-tutorial`) has a method
2222
called :meth:`~matplotlib.artist.Artist.findobj` that can be used to
@@ -27,16 +27,16 @@ following snippet finds every object in the figure which has a
2727
`set_color` property and makes the object blue::
2828

2929
def myfunc(x):
30-
return hasattr(x, 'set_color')
30+
return hasattr(x, 'set_color')
3131

3232
for o in fig.findobj(myfunc):
33-
o.set_color('blue')
33+
o.set_color('blue')
3434

3535
You can also filter on class instances::
3636

3737
import matplotlib.text as text
3838
for o in fig.findobj(text.Text):
39-
o.set_fontstyle('italic')
39+
o.set_fontstyle('italic')
4040

4141

4242
.. _howto-transparent:
@@ -70,7 +70,7 @@ on individual elements, eg::
7070

7171
.. _howto-multipage:
7272

73-
Save multiple plots in one pdf file
73+
Save multiple plots to one pdf file
7474
-----------------------------------
7575

7676
Many image file formats can only have one image per file, but some
@@ -87,7 +87,7 @@ the format::
8787

8888
savefig(pp, format='pdf')
8989

90-
A simpler way is to call
90+
An easier way is to call
9191
:meth:`PdfPages.savefig <matplotlib.backends.backend_pdf.PdfPages.savefig>`::
9292

9393
pp.savefig()
@@ -144,8 +144,7 @@ specify the location explicitly::
144144
ax = fig.add_axes([left, bottom, width, height])
145145

146146
where all values are in fractional (0 to 1) coordinates. See
147-
`axes_demo.py <http://matplotlib.sf.net/examples/axes_demo.py>`_ for
148-
an example of placing axes manually.
147+
:ref:`pylab_examples-axes_demo` for an example of placing axes manually.
149148

150149
.. _howto-auto-adjust:
151150

@@ -174,8 +173,8 @@ connecting
174173
get the window extent there, and then do something with it, eg move
175174
the left of the canvas over; see :ref:`event-handling-tutorial`.
176175

177-
Here is that gets a bounding box in relative figure coordinates (0..1)
178-
of each of the labels and uses it to move the left of the subplots
176+
Here is an example that gets a bounding box in relative figure coordinates
177+
(0..1) of each of the labels and uses it to move the left of the subplots
179178
over so that the tick labels fit in the figure
180179

181180
.. plot:: pyplots/auto_subplots_adjust.py
@@ -250,8 +249,8 @@ to achieve the desired plot::
250249
ind = np.arange(N) # the evenly spaced plot indices
251250

252251
def format_date(x, pos=None):
253-
thisind = np.clip(int(x+0.5), 0, N-1)
254-
return r.date[thisind].strftime('%Y-%m-%d')
252+
thisind = np.clip(int(x+0.5), 0, N-1)
253+
return r.date[thisind].strftime('%Y-%m-%d')
255254

256255
fig = plt.figure()
257256
ax = fig.add_subplot(111)
@@ -405,15 +404,15 @@ A frequent request is to have two scales for the left and right
405404
y-axis, which is possible using :func:`~matplotlib.pyplot.twinx` (more
406405
than two scales are not currently supported, though it is on the wish
407406
list). This works pretty well, though there are some quirks when you
408-
are trying to interactively pan and zoom, since both scales do not get
407+
are trying to interactively pan and zoom, because both scales do not get
409408
the signals.
410409

411-
The approach :func:`~matplotlib.pyplot.twinx` (and its sister
412-
:func:`~matplotlib.pyplot.twiny`) uses is to use *2 different axes*,
410+
The approach uses :func:`~matplotlib.pyplot.twinx` (and its sister
411+
:func:`~matplotlib.pyplot.twiny`) to use *2 different axes*,
413412
turning the axes rectangular frame off on the 2nd axes to keep it from
414413
obscuring the first, and manually setting the tick locs and labels as
415414
desired. You can use separate matplotlib.ticker formatters and
416-
locators as desired since the two axes are independent::
415+
locators as desired because the two axes are independent::
417416

418417
import numpy as np
419418
import matplotlib.pyplot as plt
@@ -444,7 +443,7 @@ Generate images without having a window popup
444443

445444
The easiest way to do this is use an image backend (see
446445
:ref:`what-is-a-backend`) such as Agg (for PNGs), PDF, SVG or PS. In
447-
your figure generating script, just place call
446+
your figure generating script, just call the
448447
:func:`matplotlib.use` directive before importing pylab or
449448
pyplot::
450449

@@ -474,7 +473,7 @@ not want a user interface window, you do not need to call ``show`` (see
474473
:ref:`howto-batch` and :ref:`what-is-a-backend`).
475474

476475

477-
Because it is expensive to draw, matplotlib does not want to redrawing the figure
476+
Because it is expensive to draw, matplotlib does not want redraw the figure
478477
many times in a script such as the following::
479478

480479
plot([1,2,3]) # draw here ?
@@ -485,7 +484,7 @@ many times in a script such as the following::
485484

486485

487486
It is *possible* to force matplotlib to draw after every command,
488-
which is what you usually want when working interactively at the
487+
which might be what you want when working interactively at the
489488
python console (see :ref:`mpl-shell`), but in a script you want to
490489
defer all drawing until the script has executed. This is especially
491490
important for complex figures that take some time to draw.
@@ -537,7 +536,7 @@ want to receive them in a standard format. If possible, for any
537536
non-trivial change, please include a complete, free-standing example
538537
that the developers can run unmodified which shows the undesired
539538
behavior pre-patch and the desired behavior post-patch, with a clear
540-
verbal description of what to look for. The original developer may
539+
verbal description of what to look for. A developer may
541540
have written the function you are working on years ago, and may no
542541
longer be with the project, so it is quite possible you are the world
543542
expert on the code you are patching and we want to hear as much detail
@@ -560,7 +559,7 @@ Contribute to matplotlib documentation
560559
-----------------------------------------
561560

562561
matplotlib is a big library, which is used in many ways, and the
563-
documentation we have only scratches the surface of everything it can
562+
documentation has only scratched the surface of everything it can
564563
do. So far, the place most people have learned all these features are
565564
through studying the examples (:ref:`how-to-search-examples`), which is a
566565
recommended and great way to learn, but it would be nice to have more
@@ -569,7 +568,7 @@ corners. This is where you come in.
569568

570569
There is a good chance you know more about matplotlib usage in some
571570
areas, the stuff you do every day, than many of the core developers
572-
who write most of the documentation. Just pulled your hair out
571+
who wrote most of the documentation. Just pulled your hair out
573572
compiling matplotlib for windows? Write a FAQ or a section for the
574573
:ref:`installing` page. Are you a digital signal processing wizard?
575574
Write a tutorial on the signal analysis plotting functions like
@@ -582,10 +581,10 @@ for it in the :ref:`users-guide-index`. Bundle matplotlib in a
582581

583582
matplotlib is documented using the `sphinx
584583
<http://sphinx.pocoo.org/index.html>`_ extensions to restructured text
585-
`ReST <http://docutils.sourceforge.net/rst.html>`_. sphinx is a
584+
`(ReST) <http://docutils.sourceforge.net/rst.html>`_. sphinx is an
586585
extensible python framework for documentation projects which generates
587586
HTML and PDF, and is pretty easy to write; you can see the source for this
588-
document or any page on this site by clicking on *Show Source* link
587+
document or any page on this site by clicking on the *Show Source* link
589588
at the end of the page in the sidebar (or `here
590589
<../_sources/faq/howto_faq.txt>`_ for this document).
591590

@@ -630,9 +629,9 @@ Agg is to call::
630629
For more on configuring your backend, see
631630
:ref:`what-is-a-backend`.
632631

633-
Alternatively, you can avoid pylab/pyplot altogeher, which will give
632+
Alternatively, you can avoid pylab/pyplot altogether, which will give
634633
you a little more control, by calling the API directly as shown in
635-
`agg_oo.py <http://matplotlib.sf.net/examples/api/agg_oo.py>`_ .
634+
:ref:`api_examples-agg_oo.py`.
636635

637636
You can either generate hardcopy on the filesystem by calling savefig::
638637

@@ -650,7 +649,9 @@ or by saving to a file handle::
650649
import sys
651650
fig.savefig(sys.stdout)
652651

653-
Here is an example using the Python Imaging Library PIL. First the figure is saved to a StringIO objectm which is then fed to PIL for further processing::
652+
Here is an example using the Python Imaging Library PIL. First the figure
653+
is saved to a StringIO objectm which is then fed to PIL for further
654+
processing::
654655

655656
import StringIO, Image
656657
imgdata = StringIO.StringIO()

doc/faq/installing_faq.rst

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If you are still having trouble, see :ref:`reporting-problems`.
4444
.. _clean-install:
4545

4646
Cleanly rebuild and reinstall everything
47-
==================================================
47+
========================================
4848

4949
The steps depend on your platform and installation method.
5050

@@ -110,6 +110,17 @@ and build and install as usual with::
110110
> cd matplotlib
111111
> python setup.py install
112112

113+
.. note::
114+
115+
If you are on debian/ubuntu, you can get all the dependencies
116+
required to build matplotlib with::
117+
118+
sudo apt-get build_dep python-matplotlib
119+
120+
This does not build matplotlib, but it does get the install the
121+
build dependencies, which will make building from source easier.
122+
123+
113124
If you want to be able to follow the development branch as it changes just replace
114125
the last step with (Make sure you have **setuptools** installed)::
115126

@@ -153,13 +164,13 @@ others in web application servers to dynamically serve up graphs.
153164
To support all of these use cases, matplotlib can target different
154165
outputs, and each of these capabililities is called a backend; the
155166
"frontend" is the user facing code, ie the plotting code, whereas the
156-
"backend" does all the dirty work behind the scenes to make the
167+
"backend" does all the hard work behind-the-scenes to make the
157168
figure. There are two types of backends: user interface backends (for
158169
use in pygtk, wxpython, tkinter, qt, macosx, or fltk) and hardcopy backends to
159170
make image files (PNG, SVG, PDF, PS).
160171

161172
There are a two primary ways to configure your backend. One is to set
162-
the ``backend`` parameter in you ``matplotlibrc`` file (see
173+
the ``backend`` parameter in your ``matplotlibrc`` file (see
163174
:ref:`customizing-matplotlib`)::
164175

165176
backend : WXAgg # use wxpython with antigrain (agg) rendering
@@ -172,8 +183,8 @@ The other is to use the matplotlib :func:`~matplotlib.use` directive::
172183
If you use the ``use`` directive, this must be done before importing
173184
:mod:`matplotlib.pyplot` or :mod:`matplotlib.pylab`.
174185

175-
If you are unsure what to do, and just want to get cranking, just set
176-
your backend to ``TkAgg``. This will do the right thing for 95% of the
186+
If you are unsure what to do, and just want to get coding, just set
187+
your backend to ``TkAgg``. This will do the right thing for most
177188
users. It gives you the option of running your scripts in batch or
178189
working interactively from the python shell, with the least amount of
179190
hassles, and is smart enough to do the right thing when you ask for
@@ -314,7 +325,7 @@ Installer.app, prompt you for a password if you need system wide
314325
installation privileges, and install to a directory like
315326
file:`/Library/Python/2.5/site-packages/`, again depedending on your
316327
python version. This directory may not be in your python path, so you
317-
can test your installation with::
328+
should test your installation with::
318329

319330
> python -c 'import matplotlib; print matplotlib.__version__, matplotlib.__file__'
320331

@@ -335,7 +346,7 @@ See also ref:`environment-variables`.
335346
easy_install from egg
336347
------------------------------
337348

338-
You can also us the eggs we build for OSX (see the `installation
349+
You can also use the eggs we build for OSX (see the `installation
339350
instructions
340351
<http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other>`_
341352
for easy_install if you do not have it on your system already). You
@@ -368,7 +379,7 @@ matplotlib download site, with ``easy_install``, getting an error::
368379

369380
If you rename ``matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg`` to
370381
``matplotlib-0.98.0-py2.5.egg``, ``easy_install`` will install it from
371-
the disk. Many Mac OS X eggs with cruft at the end of the filename,
382+
the disk. Many Mac OS X eggs have cruft at the end of the filename,
372383
which prevents their installation through easy_install. Renaming is
373384
all it takes to install them; still, it's annoying.
374385

doc/faq/troubleshooting_faq.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ and printing the ``__file__`` attribute::
4040
Each user has a :file:`.matplotlib/` directory which may contain a
4141
:ref:`matplotlibrc <customizing-with-matplotlibrc-files>` file and various
4242
caches to improve matplotlib's performance. To locate your :file:`.matplotlib/`
43-
directory, use :func:`matplotlib.get_configdir`:
43+
directory, use :func:`matplotlib.get_configdir`::
4444

4545
>>> import matplotlib as mpl
4646
>>> mpl.get_configdir()
4747
'/home/darren/.matplotlib'
4848

49-
On unix like systems, this directory is generally located in your
49+
On unix-like systems, this directory is generally located in your
5050
:envvar:`HOME` directory. On windows, it is in your documents and
5151
settings directory by default::
5252

5353
>>> import matplotlib
5454
>>> mpl.get_configdir()
55-
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
55+
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
5656

5757
If you would like to use a different configuration directory, you can
5858
do so by specifying the location in your :envvar:`MPLCONFIGDIR`
@@ -73,7 +73,7 @@ If not, please provide the following information in your e-mail to the
7373
`mailing list
7474
<http://lists.sourceforge.net/mailman/listinfo/matplotlib-users>`_:
7575

76-
* your operating system; on Linux/UNIX post the output of ``uname -a``
76+
* your operating system; (Linux/UNIX users: post the output of ``uname -a``)
7777

7878
* matplotlib version::
7979

@@ -82,7 +82,7 @@ If not, please provide the following information in your e-mail to the
8282
* where you obtained matplotlib (e.g. your Linux distribution's
8383
packages or the matplotlib Sourceforge site, or the enthought
8484
python distribution `EPD
85-
<http://www.enthought.com/products/epd.php>`_.
85+
<http://www.enthought.com/products/epd.php>`_).
8686

8787
* any customizations to your ``matplotlibrc`` file (see
8888
:ref:`customizing-matplotlib`).
@@ -145,7 +145,7 @@ simple test script in debug mode::
145145
and post :file:`build.out` and :file:`run.out` to the
146146
`matplotlib-devel
147147
<http://lists.sourceforge.net/mailman/listinfo/matplotlib-devel>`_
148-
mailing list (please do not post svn problems to the `users list
148+
mailing list (please do not post git problems to the `users list
149149
<http://lists.sourceforge.net/mailman/listinfo/matplotlib-users>`_).
150150

151151
Of course, you will want to clearly describe your problem, what you

0 commit comments

Comments
 (0)