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

Skip to content

Commit 2623a31

Browse files
committed
fixed pyplot tutorial error
svn path=/trunk/matplotlib/; revision=6309
1 parent ed89e05 commit 2623a31

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

doc/_templates/gallery.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% block body %}
66

77
<h3>Click on any image to see full size image and source code</h3>
8-
<br>
8+
<br/>
99

1010
<a href="examples/api/barchart_demo.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/barchart_demo.png" border="0" alt="barchart_demo"/></a>
1111

doc/devel/documenting_mpl.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ Getting started
88
===============
99

1010
The documentation for matplotlib is generated from ReStructured Text
11-
using the Sphinx_ documentation generation tool. Sphinx-0.4 or later
12-
is required. Currently this means we need to install from the svn
13-
repository by doing::
11+
using the Sphinx_ documentation generation tool. Sphinx-0.5 or later
12+
is required. Most developers work from the sphinx subversion repository because it is a rapidly evolving project::
1413

1514
svn co http://svn.python.org/projects/doctools/trunk sphinx
1615
cd sphinx

doc/faq/howto_faq.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,13 @@ external tool to convert them to a movie. You can use `mencoder
332332
which is part of the `mplayer <http://www.mplayerhq.hu>`_ suite
333333
for this::
334334

335-
336335
#fps (frames per second) controls the play speed
337336
mencoder 'mf://*.png' -mf type=png:fps=10 -ovc \\
338337
lavc -lavcopts vcodec=wmv2 -oac copy -o animation.avi
339338

340339
The swiss army knife of image tools, ImageMagick's `convert
341340
<http://www.imagemagick.org/script/convert.php>`_ works for this as
342-
well.<p>
341+
well.
343342

344343
Here is a simple example script that saves some PNGs, makes them into
345344
a movie, and then cleans up::
@@ -617,6 +616,14 @@ or by saving to a file handle::
617616
import sys
618617
fig.savefig(sys.stdout)
619618

619+
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::
620+
621+
import StringIO, Image
622+
imgdata = StringIO.StringIO()
623+
fig.savefig(imgdata, format='png')
624+
imgdata.seek(0) # rewind the data
625+
im = Image.open(imgdata)
626+
620627

621628
matplotlib with apache
622629
------------------------------------

doc/users/pyplot_tutorial.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ functions are directed to the current axes
1515
.. plot:: pyplots/pyplot_simple.py
1616
:include-source:
1717

18-
You may be wondering why the x-axis ranges from 0-3 and the y-axis
19-
from 1-4. If you provide a single list or array to the
18+
You may be wondering why the x-axis ranges from 0-2 and the y-axis
19+
from 1-3. If you provide a single list or array to the
2020
:func:`~matplotlib.pyplot.plot` command, matplotlib assumes it a
2121
sequence of y values, and automatically generates the x values for
2222
you. Since python ranges start with 0, the default x vector has the
2323
same length as y but starts with 0. Hence the x data are
24-
``[0,1,2,3]``.
24+
``[0,1,2]``.
2525

2626
:func:`~matplotlib.pyplot.plot` is a versatile command, and will take
2727
an arbitrary number of arguments. For example, to plot x versus y,

0 commit comments

Comments
 (0)