8000 Merge v2.x into master by jenshnielsen · Pull Request #6246 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Merge v2.x into master #6246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Mar 30, 2016
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
605a8af
ENH: add XKCD colorname -> hex mapping
tacaswell Dec 31, 2015
010be02
MNT: normalize X11/CSS/HTML colors
tacaswell Jan 2, 2016
e392d03
MNT: normalize to use un-spaced names in XKCD map
tacaswell Jan 2, 2016
e049a49
MNT: unify string handling
tacaswell Jan 2, 2016
bda202b
MNT: always validate alpha as [0, 1] or None
tacaswell Jan 2, 2016
b2543f6
MNT: add xkcd prefix + switch priority order
tacaswell Jan 5, 2016
9feeb9e
FIX: restore single character colors to rgb tuples
tacaswell Jan 18, 2016
3d4a517
DOC: remove last paypal link
tacaswell Feb 8, 2016
b93bd5d
WIP color docs
tacaswell Feb 14, 2016
db5ef16
Update LICENSE file to match doc/users/license.rst
mdboom Mar 2, 2016
80a8e53
DOC: remove static images
tacaswell Feb 8, 2016
f3d4415
DOC/MNT: remove unused/outdate files
tacaswell Mar 7, 2016
9963cca
FIX: use lowercase in map
tacaswell Mar 7, 2016
fafa36f
DOC: string -> color mappings
tacaswell Mar 7, 2016
20db6a0
Merge pull request #6124 from estan/qt5-example-fixes
tacaswell Mar 7, 2016
7c4eb6b
Fixed year issues
mdboom Mar 7, 2016
1bd80a2
Merge pull request #6098 from mdboom/license-update
tacaswell Mar 7, 2016
d74eca5
Merge pull request #6194 from story645/patch-1
tacaswell Mar 21, 2016
e277f99
Merge pull request #6195 from story645/patch-2
tacaswell Mar 21, 2016
40cfef1
Merge pull request #6205 from mdboom/fix-stringio
tacaswell Mar 26, 2016
9687f65
TST: add smoke test for the color blue
tacaswell Mar 28, 2016
9655f45
Merge pull request #5775 from tacaswell/enh_xkcd_colors
jenshnielsen Mar 29, 2016
e981e1e
Merge pull request #6178 from mdboom/macagg
efiring Mar 28, 2016
3a944a6
Merge pull request #6238 from jenshnielsen/fixsphinx140issues
tacaswell Mar 30, 2016
bf82d92
Merge pull request #5973 from tacaswell/doc_update_donation
jenshnielsen Mar 30, 2016
860fdfe
Merge pull request #6244 from matplotlib/v1.5.1-doc
jenshnielsen Mar 30, 2016
9e1668b
Merge pull request #6245 from matplotlib/v1.5.x
jenshnielsen Mar 30, 2016
6461814
Merge remote-tracking branch 'matplotlib/v2.x' into mergev2.xmaster
jenshnielsen Mar 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
74 changes: 62 additions & 12 deletions LICENSE/LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
LICENSE AGREEMENT FOR MATPLOTLIB 1.2.0
--------------------------------------
License agreement for matplotlib versions 1.3.0 and later
=========================================================

1. This LICENSE AGREEMENT is between the Matplotlib Development Team
("MDT"), and the Individual or Organization ("Licensee") accessing and
otherwise using matplotlib software in source or binary form and its
associated documentation.

2. Subject to the terms and conditions of this License Agreement, MDT
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
to reproduce, analyze, test, perform and/or display publicly, prepare
derivative works, distribute, and otherwise use matplotlib
alone or in any derivative version, provided, however, that MDT's
License Agreement and MDT's notice of copyright, i.e., "Copyright (c)
2012- Matplotlib Development Team; All Rights Reserved" are retained in
matplotlib alone or in any derivative version prepared by
Licensee.

3. In the event Licensee prepares a derivative work that is based on or
incorporates matplotlib or any part thereof, and wants to
make the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to matplotlib .

4. MDT is making matplotlib available to Licensee on an "AS
IS" basis. MDT MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, MDT MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB
WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.

5. MDT SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
MATPLOTLIB , OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
THE POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.

7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between MDT and
Licensee. This License Agreement does not grant permission to use MDT
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.

8. By copying, installing or otherwise using matplotlib ,
Licensee agrees to be bound by the terms and conditions of this License
Agreement.

License agreement for matplotlib versions prior to 1.3.0
========================================================

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

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

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

5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
1.2.0 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
MATPLOTLIB 1.2.0, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
MATPLOTLIB , OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
THE POSSIBILITY THEREOF.

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

8. By copying, installing or otherwise using matplotlib 1.2.0,
8. By copying, installing or otherwise using matplotlib,
Licensee agrees to be bound by the terms and conditions of this License
Agreement.
Agreement.
2 changes: 1 addition & 1 deletion doc/_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h1>Open source</h1>

<p>
Please
consider <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X9T4KLZT2794S">donating
consider <a href="https://www.flipcause.com/widget/MjI1OA==">donating
to the matplotlib project</a> through the Numfocus organization or to
the <a href="http://numfocus.org/johnhunter/">John Hunter Technology Fellowship</a>.
</p>
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
plot_formats = [('png', 80), ('hires.png', 200), ('pdf', 50)]

# Subdirectories in 'examples/' directory of package and titles for gallery
mpl_example_sections = (
mpl_example_sections = [
('lines_bars_and_markers', 'Lines, bars, and markers'),
('shapes_and_collections', 'Shapes and collections'),
('statistics', 'Statistical plots'),
Expand All @@ -138,7 +138,7 @@
('axes_grid', 'axes_grid toolkit'),
('units', 'units'),
('widgets', 'widgets'),
)
]


# Github extension
Expand Down
7 changes: 4 additions & 3 deletions doc/faq/howto_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,12 @@ or by saving to a file handle::
fig.savefig(sys.stdout)

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

import StringIO, Image
imgdata = StringIO.StringIO()
from io import BytesIO
from PIL import Image
imgdata = BytesIO()
fig.savefig(imgdata, format='png')
imgdata.seek(0) # rewind the data
im = Image.open(imgdata)
Expand Down
9 changes: 5 additions & 4 deletions doc/faq/usage_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,9 @@ and turned off via :func:`matplotlib.pyplot.ioff`.

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


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

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

ax = plt.gca()
Expand Down
75 changes: 0 additions & 75 deletions doc/pyplots/make.py

This file was deleted.

Binary file removed doc/pyplots/plotmap.hires.png
Binary file not shown.
Binary file removed doc/pyplots/plotmap.pdf
Binary file not shown.
Binary file removed doc/pyplots/plotmap.png
Binary file not shown.
Binary file removed doc/pyplots/tex_demo.hires.png
Binary file not shown.
Binary file removed doc/pyplots/tex_demo.pdf
Binary file not shown.
Binary file removed doc/pyplots/tex_unicode_demo.hires.png
Binary file not shown.
Binary file removed doc/pyplots/tex_unicode_demo.pdf
Binary file not shown.
Binary file removed doc/pyplots/tex_unicode_demo.png
Binary file not shown.
5 changes: 2 additions & 3 deletions doc/users/style_sheets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ just add::

To list all available styles, use::

>>> print plt.style.available
>>> print(plt.style.available)


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


>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>>
>>> with plt.style.context(('dark_background')):
>>> plt.plot(np.sin(np.linspace(0, 2*np.pi)), 'r-o')
>>> plt.plot(np.sin(np.linspace(0, 2 * np.pi)), 'r-o')
>>>
>>> # Some plotting code with the default style
>>>
Expand Down
6 changes: 3 additions & 3 deletions examples/misc/svg_filter_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
ax.set_xlim(0., 1.)
ax.set_ylim(0., 1.)

# save the figure as a string in the svg format.
from io import StringIO
f = StringIO()
# save the figure as a bytes string in the svg format.
from io import BytesIO
f = BytesIO()
plt.savefig(f, format="svg")


Expand Down
4 changes: 2 additions & 2 deletions examples/misc/svg_filter_pie.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@


# save
from io import StringIO
f = StringIO()
from io import BytesIO
f = BytesIO()
plt.savefig(f, format="svg")

import xml.etree.cElementTree as ET
Expand Down
6 changes: 3 additions & 3 deletions examples/user_interfaces/embedding_in_qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import matplotlib
# Make sure that we are using QT5
matplotlib.use('Qt5Agg')
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5 import QtCore, QtWidgets

from numpy import arange, sin, pi
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
Expand Down Expand Up @@ -117,8 +117,8 @@ def closeEvent(self, ce):
self.fileQuit()

def about(self):
QtGui.QMessageBox.about(self, "About",
"""embedding_in_qt5.py example
QtWidgets.QMessageBox.about(self, "About",
"""embedding_in_qt5.py example
Copyright 2005 Florent Rougon, 2006 Darren Dale, 2015 Jens H Nielsen

This program is a simple example of a Qt5 application embedding matplotlib
Expand Down
4 changes: 2 additions & 2 deletions examples/user_interfaces/svg_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import numpy as np
import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
from io import StringIO
from io import BytesIO
import json

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

# Save SVG in a fake file object.
f = StringIO()
f = BytesIO()
plt.savefig(f, format="svg")

# Create XML tree from the SVG file.
Expand Down
4 changes: 2 additions & 2 deletions examples/user_interfaces/svg_tooltip.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
from io import StringIO
from io import BytesIO

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

Expand Down Expand Up @@ -72,7 +72,7 @@
ax.set_ylim(-30, 30)
ax.set_aspect('equal')

f = StringIO()
f = BytesIO()
plt.savefig(f, format="svg")

# --- Add interactivity ---
Expand Down
13 changes: 6 additions & 7 deletions lib/matplotlib/sphinxext/mathmpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,15 @@ def latex2html(node, source):

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


def setup(app):
setup.app = app

app.add_node(latex_math)
app.add_role('math', math_role)

# Add visit/depart methods to HTML-Translator:
def visit_latex_math_html(self, node):
source = self.document.attributes['source']
self.body.append(latex2html(node, source))

def depart_latex_math_html(self, node):
pass

Expand All @@ -109,13 +108,13 @@ def visit_latex_math_latex(self, node):
self.body.extend(['\\begin{equation}',
node['latex'],
'\\end{equation}'])

def depart_latex_math_latex(self, node):
pass

app.add_node(latex_math, html=(visit_latex_math_html,
depart_latex_math_html))
app.add_node(latex_math, latex=(visit_latex_math_latex,
depart_latex_math_latex))
app.add_node(latex_math,
html=(visit_latex_math_html, depart_latex_math_html),
latex=(visit_latex_math_latex, depart_latex_math_latex))
app.add_role('math', math_role)
app.add_directive('math', math_directive,
True, (0, 0, 0), **options_spec)
Loading
0