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

Skip to content

Commit 860fdfe

Browse files
committed
Merge pull request matplotlib#6244 from matplotlib/v1.5.1-doc
merge V1.5.1 doc into 1.5.x
2 parents c4825a3 + bf82d92 commit 860fdfe

22 files changed

+104
-125
lines changed

LICENSE/LICENSE

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
1-
LICENSE AGREEMENT FOR MATPLOTLIB 1.2.0
2-
--------------------------------------
1+
License agreement for matplotlib versions 1.3.0 and later
2+
=========================================================
3+
4+
1. This LICENSE AGREEMENT is between the Matplotlib Development Team
5+
("MDT"), and the Individual or Organization ("Licensee") accessing and
6+
otherwise using matplotlib software in source or binary form and its
7+
associated documentation.
8+
9+
2. Subject to the terms and conditions of this License Agreement, MDT
10+
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
11+
to reproduce, analyze, test, perform and/or display publicly, prepare
12+
derivative works, distribute, and otherwise use matplotlib
13+
alone or in any derivative version, provided, however, that MDT's
14+
License Agreement and MDT's notice of copyright, i.e., "Copyright (c)
15+
2012- Matplotlib Development Team; All Rights Reserved" are retained in
16+
matplotlib alone or in any derivative version prepared by
17+
Licensee.
18+
19+
3. In the event Licensee prepares a derivative work that is based on or
20+
incorporates matplotlib or any part thereof, and wants to
21+
make the derivative work available to others as provided herein, then
22+
Licensee hereby agrees to include in any such work a brief summary of
23+
the changes made to matplotlib .
24+
25+
4. MDT is making matplotlib available to Licensee on an "AS
26+
IS" basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
27+
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND
28+
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
29+
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB
30+
WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
31+
32+
5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
33+
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
34+
LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
35+
MATPLOTLIB , OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
36+
THE POSSIBILITY THEREOF.
37+
38+
6. This License Agreement will automatically terminate upon a material
39+
breach of its terms and conditions.
40+
41+
7. Nothing in this License Agreement shall be deemed to create any
42+
relationship of agency, partnership, or joint venture between MDT and
43+
Licensee. This License Agreement does not grant permission to use MDT
44+
trademarks or trade name in a trademark sense to endorse or promote
45+
products or services of Licensee, or any third party.
46+
47+
8. By copying, installing or otherwise using matplotlib ,
48+
Licensee agrees to be bound by the terms and conditions of this License
49+
Agreement.
50+
51+
License agreement for matplotlib versions prior to 1.3.0
52+
========================================================
353

454
1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the
555
Individual or Organization ("Licensee") accessing and otherwise using
@@ -9,30 +59,30 @@ documentation.
959
2. Subject to the terms and conditions of this License Agreement, JDH
1060
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
1161
to reproduce, analyze, test, perform and/or display publicly, prepare
12-
derivative works, distribute, and otherwise use matplotlib 1.2.0
62+
derivative works, distribute, and otherwise use matplotlib
1363
alone or in any derivative version, provided, however, that JDH's
1464
License Agreement and JDH's notice of copyright, i.e., "Copyright (c)
1565
2002-2011 John D. Hunter; All Rights Reserved" are retained in
16-
matplotlib 1.2.0 alone or in any derivative version prepared by
66+
matplotlib alone or in any derivative version prepared by
1767
Licensee.
1868

1969
3. In the event Licensee prepares a derivative work that is based on or
20-
incorporates matplotlib 1.2.0 or any part thereof, and wants to
70+
incorporates matplotlib or any part thereof, and wants to
2171
make the derivative work available to others as provided herein, then
2272
Licensee hereby agrees to include in any such work a brief summary of
23-
the changes made to matplotlib 1.2.0.
73+
the changes made to matplotlib.
2474

25-
4. JDH is making matplotlib 1.2.0 available to Licensee on an "AS
75+
4. JDH is making matplotlib available to Licensee on an "AS
2676
IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
2777
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND
2878
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
29-
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 1.2.0
79+
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB
3080
WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
3181

3282
5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
33-
1.2.0 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
83+
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
3484
LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
35-
MATPLOTLIB 1.2.0, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
85+
MATPLOTLIB , OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
3686
THE POSSIBILITY THEREOF.
3787

3888
6. This License Agreement will automatically terminate upon a material
@@ -44,6 +94,6 @@ Licensee. This License Agreement does not grant permission to use JDH
4494
trademarks or trade name in a trademark sense to endorse or promote
4595
products or services of Licensee, or any third party.
4696

47-
8. By copying, installing or otherwise using matplotlib 1.2.0,
97+
8. By copying, installing or otherwise using matplotlib,
4898
Licensee agrees to be bound by the terms and conditions of this License
49-
Agreement.
99+
Agreement.

doc/_templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ <h1>Open source</h1>
181181

182182
<p>
183183
Please
184-
consider <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X9T4KLZT2794S">donating
184+
consider <a href="https://www.flipcause.com/widget/MjI1OA==">donating
185185
to the matplotlib project</a> through the Numfocus organization or to
186186
the <a href="http://numfocus.org/johnhunter/">John Hunter Technology Fellowship</a>.
187187
</p>

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
plot_formats = [('png', 80), ('hires.png', 200), ('pdf', 50)]
119119

120120
# Subdirectories in 'examples/' directory of package and titles for gallery
121-
mpl_example_sections = (
121+
mpl_example_sections = [
122122
('lines_bars_and_markers', 'Lines, bars, and markers'),
123123
('shapes_and_collections', 'Shapes and collections'),
124124
('statistics', 'Statistical plots'),
@@ -138,7 +138,7 @@
138138
('axes_grid', 'axes_grid toolkit'),
139139
('units', 'units'),
140140
('widgets', 'widgets'),
141-
)
141+
]
142142

143143

144144
# Github extension

doc/faq/howto_faq.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,12 @@ or by saving to a file handle::
632632
fig.savefig(sys.stdout)
633633

634634
Here is an example using `Pillow <http://python-imaging.github.io/>`_.
635-
First, the figure is saved to a StringIO object which is then fed to
635+
First, the figure is saved to a BytesIO object which is then fed to
636636
Pillow for further processing::
637637

638-
import StringIO, Image
639-
imgdata = StringIO.StringIO()
638+
from io import BytesIO
639+
from PIL import Image
640+
imgdata = BytesIO()
640641
fig.savefig(imgdata, format='png')
641642
imgdata.seek(0) # rewind the data
642643
im = Image.open(imgdata)

doc/faq/usage_faq.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,9 @@ and turned off via :func:`matplotlib.pyplot.ioff`.
522522

523523
.. note::
524524
Interactive mode works with suitable backends in ipython and in
525-
the ordinary python shell, but it does *not* work in the IDLE IDE.
525+
the ordinary python shell, but it does *not* work in the IDLE IDE.
526+
If the default backend does not support interactivity, an interactive
527+
backend can be explicitly activated using any of the methods discussed in `What is a backend?`_.
526528

527529

528530
Interactive example
@@ -545,9 +547,8 @@ can type additional commands such as::
545547

546548
and you will see the plot being updated after each line. This is
547549
because you are in interactive mode *and* you are using pyplot
548-
functions. Now try an alternative method of modifying the
549-
plot. Get a
550-
reference to the :class:`~matplotlib.axes.Axes` instance, and
550+
functions. Now try an alternative method of modifying the
551+
plot. Get a reference to the :class:`~matplotlib.axes.Axes` instance, and
551552
call a method of that instance::
552553

553554
ax = plt.gca()

doc/pyplots/make.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

doc/pyplots/plotmap.hires.png

-674 KB
Binary file not shown.

doc/pyplots/plotmap.pdf

-1.73 MB
Binary file not shown.

doc/pyplots/plotmap.png

-241 KB
Binary file not shown.

doc/pyplots/tex_demo.hires.png

-52.9 KB
Binary file not shown.

doc/pyplots/tex_demo.pdf

-311 KB
Binary file not shown.
-52.9 KB
Binary file not shown.

doc/pyplots/tex_unicode_demo.pdf

-570 Bytes
Binary file not shown.

doc/pyplots/tex_unicode_demo.png

-21.9 KB
Binary file not shown.

doc/users/style_sheets.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ just add::
1818

1919
To list all available styles, use::
2020

21-
>>> print plt.style.available
21+
>>> print(plt.style.available)
2222

2323

2424
Defining your own style
@@ -72,12 +72,11 @@ to change the global styling, the style package provides a context manager
7272
for limiting your changes to a specific scope. To isolate the your styling
7373
changes, you can write something like the following::
7474

75-
7675
>>> import numpy as np
7776
>>> import matplotlib.pyplot as plt
7877
>>>
7978
>>> with plt.style.context(('dark_background')):
80-
>>> plt.plot(np.sin(np.linspace(0, 2*np.pi)), 'r-o')
79+
>>> plt.plot(np.sin(np.linspace(0, 2 * np.pi)), 'r-o')
8180
>>>
8281
>>> # Some plotting code with the default style
8382
>>>

examples/misc/svg_filter_line.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
ax.set_xlim(0., 1.)
5252
ax.set_ylim(0., 1.)
5353

54-
# save the figure as a string in the svg format.
55-
from io import StringIO
56-
f = StringIO()
54+
# save the figure as a bytes string in the svg format.
55+
from io import BytesIO
56+
f = BytesIO()
5757
plt.savefig(f, format="svg")
5858

5959

examples/misc/svg_filter_pie.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343

4444
# save
45-
from io import StringIO
46-
f = StringIO()
45+
from io import BytesIO
46+
f = BytesIO()
4747
plt.savefig(f, format="svg")
4848

4949
import xml.etree.cElementTree as ET

examples/user_interfaces/embedding_in_qt5.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import matplotlib
1818
# Make sure that we are using QT5
1919
matplotlib.use('Qt5Agg')
20-
from PyQt5 import QtGui, QtCore, QtWidgets
20+
from PyQt5 import QtCore, QtWidgets
2121

2222
from numpy import arange, sin, pi
2323
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
@@ -117,8 +117,8 @@ def closeEvent(self, ce):
117117
self.fileQuit()
118118

119119
def about(self):
120-
QtGui.QMessageBox.about(self, "About",
121-
"""embedding_in_qt5.py example
120+
QtWidgets.QMessageBox.about(self, "About",
121+
"""embedding_in_qt5.py example
122122
Copyright 2005 Florent Rougon, 2006 Darren Dale, 2015 Jens H Nielsen
123123
124124
This program is a simple example of a Qt5 application embedding matplotlib

examples/user_interfaces/svg_histogram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import numpy as np
3636
import matplotlib.pyplot as plt
3737
import xml.etree.ElementTree as ET
38-
from io import StringIO
38+
from io import BytesIO
3939
import json
4040

4141
plt.rcParams['svg.embed_char_paths'] = 'none'
@@ -76,7 +76,7 @@
7676
t.set_gid('leg_text_%d' % i)
7777

7878
# Save SVG in a fake file object.
79-
f = StringIO()
79+
f = BytesIO()
8080
plt.savefig(f, format="svg")
8181

8282
# Create XML tree from the SVG file.

examples/user_interfaces/svg_tooltip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import matplotlib.pyplot as plt
2626
import xml.etree.ElementTree as ET
27-
from io import StringIO
27+
from io import BytesIO
2828

2929
ET.register_namespace("", "http://www.w3.org/2000/svg")
3030

@@ -72,7 +72,7 @@
7272
ax.set_ylim(-30, 30)
7373
ax.set_aspect('equal')
7474

75-
f = StringIO()
75+
f = BytesIO()
7676
plt.savefig(f, format="svg")
7777

7878
# --- Add interactivity ---

lib/matplotlib/sphinxext/mathmpl.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,15 @@ def latex2html(node, source):
8787

8888
return '<img src="%s/%s.png" %s%s/>' % (path, name, cls, style)
8989

90+
9091
def setup(app):
9192
setup.app = app
9293

93-
app.add_node(latex_math)
94-
app.add_role('math', math_role)
95-
9694
# Add visit/depart methods to HTML-Translator:
9795
def visit_latex_math_html(self, node):
9896
source = self.document.attributes['source']
9997
self.body.append(latex2html(node, source))
98+
10099
def depart_latex_math_html(self, node):
101100
pass
102101

@@ -109,13 +108,13 @@ def visit_latex_math_latex(self, node):
109108
self.body.extend(['\\begin{equation}',
110109
node['latex'],
111110
'\\end{equation}'])
111+
112112
def depart_latex_math_latex(self, node):
113113
pass
114114

115-
app.add_node(latex_math, html=(visit_latex_math_html,
116-
depart_latex_math_html))
117-
app.add_node(latex_math, latex=(visit_latex_math_latex,
118-
depart_latex_math_latex))
115+
app.add_node(latex_math,
116+
html=(visit_latex_math_html, depart_latex_math_html),
117+
latex=(visit_latex_math_latex, depart_latex_math_latex))
119118
app.add_role('math', math_role)
120119
app.add_directive('math', math_directive,
121120
True, (0, 0, 0), **options_spec)

0 commit comments

Comments
 (0)