8000 Merge remote-tracking branch 'matplotlib/v1.5.x' into v2.x · matplotlib/matplotlib@1512593 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1512593

Browse files
committed
Merge remote-tracking branch 'matplotlib/v1.5.x' into v2.x
2 parents 8356fc2 + 972266d commit 1512593

File tree

12 files changed

+247
-267
lines changed

12 files changed

+247
-267
lines changed

INSTALL

Lines changed: 35 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.. The source of this document is INSTALL. During the doc build process,
22
.. this file is copied over to doc/users/installing.rst.
33
.. Therefore, you must edit INSTALL, *not* doc/users/installing.rst!
4+
.. _pip: https://pypi.python.org/pypi/pip/
45

56
**********
67
Installing
@@ -21,14 +22,12 @@ Most platforms : scientific Python distributions
2122
The first option is to use one of the pre-packaged python
2223
distributions that already provide matplotlib built-in. The
2324
Continuum.io Python distribution (`Anaconda
24-
<https://store.continuum.io/cshop/anaconda/>`_ or `miniconda
25+
<https://www.continuum.io/downloads/>`_ or `miniconda
2526
<http://conda.pydata.org/miniconda.html>`_) and the Enthought
2627
distribution `(Canopy) <https://www.enthought.com/products/canopy/>`_
2728
are both excellent choices that "just work" out of the box for
2829
Windows, OSX and common Linux platforms. Both of these distributions
29-
include matplotlib and *lots* of other useful tools. Another
30-
excellent alternative for Windows users is `Python (x, y)
31-
<https://code.google.com/p/pythonxy>`_ .
30+
include matplotlib and *lots* of other useful tools.
3231

3332

3433
Linux : using your package manager
@@ -44,43 +43,36 @@ Mac OSX : using pip
4443
-------------------
4544

4645
If you are on Mac OSX you can probably install matplotlib binaries using the
47-
standard Python installation program `pip <https://pypi.python.org/pypi/pip>`_.
46+
standard Python installation program pip_.
4847
See :ref:`install_osx_binaries`.
4948

49+
.. _installing_windows:
5050

5151
Windows
5252
-------
5353

5454
If you don't already have Python installed, we recommend using
5555
one of the `scipy-stack compatible Python distributions
5656
<http://www.scipy.org/install.html>`_ such as WinPython, Python(x,y),
57-
Enthought Canopy, or Continuum Anaconda, which have matplotlib and
58-
many of its dependencies, plus other useful packages, preinstalled.
59-
60-
For `standard Python <http://www.python.org/download/>`_ installations
61-
you will also need to install compatible versions of
62-
`setuptools <https://pypi.python.org/pypi/setuptools/>`_,
63-
`numpy <https://pypi.python.org/pypi/numpy/>`_,
64-
`python-dateutil <https://pypi.python.org/pypi/python-dateutil/>`_,
65-
`pytz <https://pypi.python.org/pypi/pytz>`_,
66-
`pyparsing <https://pypi.python.org/pypi/pyparsing/>`_, and
67-
`cycler <https://pypi.python.org/pypi/Cycler>`_
68-
in addition to
69-
`matplotlib <http://pypi.python.org/pypi/matplotlib/>`_.
70-
71-
For Python 3.5 the `Visual C++ Redistributable for Visual Studio 2015
72-
<http://www.microsoft.com/en-us/download/details.aspx?id=48145>`_
73-
needs to be installed.
74-
In case Python 2.7 to 3.4 are not installed for all users (not the default),
57+
Enthought Canopy, or Continuum Anaconda, which have matplotlib and many
58+
of its dependencies, plus other useful packages, preinstalled.
59+
60+
For `standard Python <https://www.python.org/download/>`_ installations,
61+
install matplotlib using pip_::
62+
63+
python -m pip install -U pip setuptools
64+
python -m pip install matplotlib
65+
66+
In case Python 2.7 or 3.4 are not installed for all users,
7567
the Microsoft Visual C++ 2008 (
7668
`64 bit <http://www.microsoft.com/download/en/details.aspx?id=15336>`__
7769
or
7870
`32 bit <http://www.microsoft.com/download/en/details.aspx?id=29>`__
79-
for Python 2.7 to 3.2) or Microsoft Visual C++ 2010 (
71+
for Python 2.7) or Microsoft Visual C++ 2010 (
8072
`64 bit <http://www.microsoft.com/en-us/download/details.aspx?id=14632>`__
8173
or
8274
`32 bit <http://www.microsoft.com/en-us/download/details.aspx?id=5555>`__
83-
for Python 3.3 and 3.4) redistributable packages need to be installed.
75+
for Python 3.4) redistributable packages need to be installed.
8476

8577
Matplotlib depends on `Pillow <https://pypi.python.org/pypi/Pillow>`_
8678
for reading and saving JPEG, BMP, and TIFF image files.
@@ -105,22 +97,23 @@ For other backends you may need to install
10597
or GhostScript.
10698

10799
TkAgg is probably the best backend for interactive use from the
108-
standard Python shell or IPython. It is enabled as the default backend
100+
standard Python shell or IPython. It is enabled as the default backend
109101
for the official binaries. GTK3 is not supported on Windows.
110102

111-
The Windows installers (:file:`*.exe`) and wheels (:file:`*.whl`) on
112-
the `PyPI download page <http://pypi.python.org/pypi/matplotlib/>`_ do
113-
not contain test data or example code. If you want to try the many
114-
demos that come in the matplotlib source distribution, download the
115-
:file:`*.tar.gz` file and look in the :file:`examples` subdirectory.
116-
To run the test suite, copy the :file:`lib\matplotlib\tests` and
117-
:file:`lib\mpl_toolkits\tests` directories from the source
118-
distribution to :file:`sys.prefix\Lib\site-packages\matplotlib` and
119-
:file:`sys.prefix\Lib\site-packages\mpl_toolkits` respectively, and
103+
The Windows wheels (:file:`*.whl`) on the `PyPI download page
104+
<https://pypi.python.org/pypi/matplotlib/>`_ do not contain test data
105+
or example code.
106+
If you want to try the many demos that come in the matplotlib source
107+
distribution, download the :file:`*.tar.gz` file and look in the
108+
:file:`examples` subdirectory.
109+
To run the test suite, copy the :file:`lib\\matplotlib\\tests` and
110+
:file:`lib\\mpl_toolkits\\tests` directories from the source
111+
distribution to :file:`sys.prefix\\Lib\\site-packages\\matplotlib` and
112+
:file:`sys.prefix\\Lib\\site-packages\\mpl_toolkits` respectively, and
120113
install `nose <https://pypi.python.org/pypi/nose>`_, `mock
121114
<https://pypi.python.org/pypi/mock>`_, Pillow, MiKTeX, GhostScript,
122115
ffmpeg, avconv, mencoder, ImageMagick, and `Inkscape
123-
<http://inkscape.org/>`_.
116+
<https://inkscape.org/>`_.
124117

125118

126119

@@ -328,17 +321,14 @@ git repository and follow the instruction in :file:`README.osx`.
328321

329322
.. _build_windows:
330323

331-
332324
Building on Windows
333325
-------------------
334326

335327
The Python shipped from http://www.python.org is compiled with Visual Studio
336-
2008 for versions before 3.3 and Visual Studio 2010 for 3.3 and later. Python
337-
extensions are recommended to be compiled with the same compiler. The .NET
338-
Framework 4.0 is required for MSBuild (you'll likely have the requisite
339-
Framework with Visual Studio). In addition to Visual Studio `CMake
340-
<http://www.cmake.org>`_ is required for building libpng.
341-
342-
Since there is no canonical Windows package manager the build methods for
343-
freetype, zlib, libpng, tcl, & tk source code are documented as a build script
328+
2008 for versions before 3.3, Visual Studio 2010 for 3.3 and 3.4, and
329+
Visual Studio 2015 for 3.5. Python extensions are recommended to be compiled
330+
with the same compiler.
331+
332+
Since there is no canonical Windows package manager, the methods for building
333+
freetype, zlib, and libpng from source code are documented as a build script
344334
at `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild>`_.

doc/_static/logo2.png

21.8 KB
Loading

doc/_templates/index.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ <h1>Introduction</h1>
6161
You can generate plots, histograms, power spectra, bar charts,
6262
errorcharts, scatterplots, etc, with just a few lines of code.
6363
For a sampling, see the <a href="{{ pathto('users/screenshots') }}">screenshots</a>, <a href="{{ pathto('gallery') }}">thumbnail</a> gallery, and
64-
<a href="examples/index.html">examples</a> directory</p>
64+
<a href="{{ pathto('examples/index') }}">examples</a> directory</p>
6565

6666
<p>For simple plotting the <tt>pyplot</tt> interface provides a
6767
MATLAB-like interface, particularly when combined
@@ -98,9 +98,7 @@ <h1>John Hunter (1968-2012)</h1>
9898

9999
<h1>Installation</h1>
100100

101-
Visit the
102-
<a href="http://matplotlib.org/users/installing.html">matplotlib
103-
installation instructions.</a>.
101+
Visit the <a href="{{ pathto('users/installing') }}">matplotlib installation instructions</a>.
104102

105103
<h1>Documentation</h1>
106104

@@ -112,8 +110,8 @@ <h1>Documentation</h1>
112110
</script>
113111

114112
<p>Trying to learn how to do a particular kind of plot? Check out
115-
the <a href="gallery.html">gallery</a>, <a href="examples/index.html">examples</a>,
116-
or the <a href="api/pyplot_summary.html">list of plotting
113+
the <a href="{{ pathto('gallery') }}">gallery</a>, <a href="{{ pathto('examples/index') }}">examples</a>,
114+
or the <a href="{{ pathto('api/pyplot_summary') }}">list of plotting
117115
commands</a>.</p>
118116

119117
<h4>Other learning resources</h4>

doc/_templates/layout.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,11 @@ <h3>{{ _('Navigation') }}</h3>
168168
</map>
169169

170170
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
171-
<a href="{{ pathto('index') }}"><img src="{{
172-
pathto("_static/logo2.svg", 1) }}" width="540px" border="0" alt="matplotlib"/></a>
171+
{%- if builder in ('htmlhelp', 'devhelp', 'latex') %}
172+
<a href="{{ pathto('index') }}"><img src="{{pathto("_static/logo2.png", 1) }}" width="540px" border="0" alt="matplotlib"/></a>
173+
{%- else %}
174+
<a href="{{ pathto('index') }}"><img src="{{pathto("_static/logo2.svg", 1) }}" width="540px" border="0" alt="matplotlib"/></a>
175+
{%- endif %}
173176
</div>
174177

175178
{% endblock %}

doc/faq/installing_faq.rst

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,6 @@ matplotlib was originally installed on your system. Follow the steps
5252
below that goes with your original installation method to cleanly
5353
remove matplotlib from your system.
5454

55-
Easy Install
56-
------------
57-
58-
1. Delete the caches from your :ref:`.matplotlib configuration directory
59-
<locating-matplotlib-config-dir>`.
60-
61-
2. Run::
62-
63-
easy_install -m matplotlib
64-
65-
66-
3. Delete any .egg files or directories from your :ref:`installation
67-
directory <locating-matplotlib-install>`.
68-
69-
70-
71-
Windows installer
72-
-----------------
73-
74-
1. Delete the caches from your :ref:`.matplotlib configuration directory
75-
<locating-matplotlib-config-dir>`.
76-
77-
2. Use :menuselection:`Start --> Control Panel` to start the :program:`Add and
78-
Remove Software` utility.
79-
8055
Source install
8156
--------------
8257

@@ -374,24 +349,4 @@ know: see :ref:`reporting-problems`.
374349
Windows Notes
375350
=============
376351

377-
We recommend you use one of the excellent python collections which include
378-
Python itself and a wide range of libraries including matplotlib:
379-
380-
- Anaconda_ from `Continuum Analytics`_
381-
- Canopy_ from Enthought_
382-
- `Python (x, y) <https://code.google.com/p/pythonxy>`_
383-
384-
Python (X, Y) is Windows-only, whereas Anaconda and Canopy are cross-platform.
385-
386-
.. _windows-installers:
387-
388-
Standalone binary installers for Windows
389-
----------------------------------------
390-
391-
If you have already installed Python and numpy, you can use one of the
392-
matplotlib binary installers for windows -- you can get these from the
393-
`the PyPI matplotlib page <http://pypi.python.org/pypi/matplotlib>`_
394-
site. Choose the files with an ``.exe`` extension that match your
395-
version of Python (e.g., ``py2.7`` if you installed Python 2.7). If
396-
you haven't already installed Python, you can get the official version
397-
from the `Python web site <http://python.org/download/>`_.
352+
See :ref:`installing_windows`.

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -634,63 +634,13 @@ def text(self, x, y, s, fontdict=None,
634634

635635
@docstring.dedent_interpd
636636
def annotate(self, *args, **kwargs):
637-
"""
638-
Create an annotation: a piece of text referring to a data
639-
point.
640-
641-
Parameters
642-
----------
643-
s : string
644-
label
645-
646-
xy : (x, y)
647-
position of element to annotate. See *xycoords* to control what
648-
coordinate system this value is interpretated in.
649-
650-
xytext : (x, y) , optional, default: None
651-
position of the label `s`. See *textcoords* to control what
652-
coordinate system this value is interpreted in.
653-
654-
xycoords : string, optional, default: "data"
655-
string that indicates what type of coordinates `xy` is. Examples:
656-
"figure points", "figure pixels", "figure fraction", "axes
657-
points", .... See `matplotlib.text.Annotation` for more details.
658-
659-
textcoords : string, optional, default: None
660-
string that indicates what type of coordinates `text` is. Examples:
661-
"figure points", "figure pixels", "figure fraction", "axes
662-
points", .... See `matplotlib.text.Annotation` for more details.
663-
664-
arrowprops : `matplotlib.lines.Line2D` properties, optional
665-
Dictionary of line properties for the arrow that connects
666-
the annotation to the point. If the dictionnary has a key
667-
`arrowstyle`, a `~matplotlib.patches.FancyArrowPatch`
668-
instance is created and drawn. See
669-
`matplotlib.text.Annotation` for more details on valid
670-
options. Default is None.
671-
672-
Returns
673-
-------
674-
a : `~matplotlib.text.Annotation`
675-
676-
677-
Notes
678-
-----
679-
680-
%(Annotation)s
681-
682-
Examples
683-
--------
684-
685-
.. plot:: mpl_examples/pylab_examples/annotation_demo2.py
686-
"""
687637
a = mtext.Annotation(*args, **kwargs)
688638
a.set_transform(mtransforms.IdentityTransform())
689639
if 'clip_on' in kwargs:
690640
a.set_clip_path(self.patch)
691641
self._add_text(a)
692642
return a
693-
643+
annotate.__doc__ = mtext.Annotation.__init__.__doc__
694644
#### Lines and spans
695645

696646
@docstring.dedent_interpd

lib/matplotlib/backends/backend_agg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def print_raw(self, filename_or_obj, *args, **kwargs):
508508
fileobj.write(renderer._renderer.buffer_rgba())
509509
finally:
510510
if close:
511-
filename_or_obj.close()
511+
fileobj.close()
512512
renderer.dpi = original_dpi
513513
print_rgba = print_raw
514514

lib/matplotlib/backends/backend_gdk.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ def _print_image(self, filename, format, *args, **kwargs):
472472
# http://www.pygtk.org/docs/pygtk/class-gdkpixbuf.html#method-gdkpixbuf--save
473473
options = restrict_dict(kwargs, ['quality'])
474474
if format in ['jpg','jpeg']:
475-
if 'quality' not in options:
476-
options['quality'] = rcParams['savefig.jpeg_quality']
477-
options['quality'] = str(options['quality'])
475+
if 'quality' not in options:
476+
options['quality'] = rcParams['savefig.jpeg_quality']
477+
options['quality'] = str(options['quality'])
478478

479479
pixbuf.save(filename, format, options=options)

lib/matplotlib/backends/backend_gtk.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,10 @@ def _print_image(self, filename, format, *args, **kwargs):
472472
# http://www.pygtk.org/docs/pygtk/class-gdkpixbuf.html#method-gdkpixbuf--save
473473
options = cbook.restrict_dict(kwargs, ['quality'])
474474
if format in ['jpg','jpeg']:
475-
if 'quality' not in options:
476-
options['quality'] = rcParams['savefig.jpeg_quality']
475+
if 'quality' not in options:
476+
options['quality'] = rcParams['savefig.jpeg_quality']
477477

478-
options['quality'] = str(options['quality'])
478+
options['quality'] = str(options['quality'])
479479

480480
if is_string_like(filename):
481481
try:

lib/matplotlib/cbook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,10 +925,10 @@ class Xlator(dict):
925925
"Perl" : "Python",
926926
}
927927
928-
print multiple_replace(adict, text)
928+
print(multiple_replace(adict, text))
929929
930930
xlat = Xlator(adict)
931-
print xlat.xlat(text)
931+
print(xlat.xlat(text))
932932
"""
933933

934934
def _make_regex(self):

0 commit comments

Comments
 (0)
0