@@ -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
2121Every matplotlib artist (see :ref: `artist-tutorial `) has a method
2222called :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
3535You 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
7676Many 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
146146where 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
174173get the window extent there, and then do something with it, eg move
175174the 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
179178over 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
405404y-axis, which is possible using :func: `~matplotlib.pyplot.twinx ` (more
406405than two scales are not currently supported, though it is on the wish
407406list). 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
409408the 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 *,
413412turning the axes rectangular frame off on the 2nd axes to keep it from
414413obscuring the first, and manually setting the tick locs and labels as
415414desired. 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
445444The 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
449448pyplot::
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
478477many 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
487486It 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
489488python console (see :ref: `mpl-shell `), but in a script you want to
490489defer all drawing until the script has executed. This is especially
491490important 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
537536non-trivial change, please include a complete, free-standing example
538537that the developers can run unmodified which shows the undesired
539538behavior 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
541540have written the function you are working on years ago, and may no
542541longer be with the project, so it is quite possible you are the world
543542expert on the code you are patching and we want to hear as much detail
@@ -560,7 +559,7 @@ Contribute to matplotlib documentation
560559-----------------------------------------
561560
562561matplotlib 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
564563do. So far, the place most people have learned all these features are
565564through studying the examples (:ref: `how-to-search-examples `), which is a
566565recommended 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
570569There is a good chance you know more about matplotlib usage in some
571570areas, 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
573572compiling matplotlib for windows? Write a FAQ or a section for the
574573:ref: `installing ` page. Are you a digital signal processing wizard?
575574Write 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
583582matplotlib 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
586585extensible python framework for documentation projects which generates
587586HTML 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
589588at 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::
630629For 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
634633you 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
637636You 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()
0 commit comments