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

Skip to content

Commit eeea15c

Browse files
author
Joel B. Mohler
committed
2 parents 05a6294 + 5cefa83 commit eeea15c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1476
-1522
lines changed

.travis.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,46 @@ env:
44
- ARTIFACTS_S3_BUCKET=matplotlib-test-results
55
- secure: RgJI7BBL8aX5FTOQe7xiXqWHMxWokd6GNUWp1NUV2mRLXPb9dI0RXqZt3UJwKTAzf1z/OtlHDmEkBoTVK81E9iUxK5npwyyjhJ8yTJmwfQtQF2n51Q1Ww9p+XSLORrOzZc7kAo6Kw6FIXN1pfctgYq2bQkrwJPRx/oPR8f6hcbY=
66
- secure: E7OCdqhZ+PlwJcn+Hd6ns9TDJgEUXiUNEI0wu7xjxB2vBRRIKtZMbuaZjd+iKDqCKuVOJKu0ClBUYxmgmpLicTwi34CfTUYt6D4uhrU+8hBBOn1iiK51cl/aBvlUUrqaRLVhukNEBGZcyqAjXSA/Qsnp2iELEmAfOUa92ZYo1sk=
7-
8-
matrix:
7+
- BUILD_DOCS=false
98
- TEST_ARGS=--no-pep8
109

11-
before_script:
12-
- gem install travis-artifacts
13-
1410
language: python
1511

16-
python:
17-
- 2.6
18-
- 2.7
19-
- 3.3
20-
- 3.4
21-
2212
matrix:
2313
include:
14+
- python: 2.6
15+
- python: 2.7
16+
- python: 3.3
17+
- python: 3.4
2418
- python: 2.7
2519
env: TEST_ARGS=--pep8
20+
- python: 2.7
21+
env: BUILD_DOCS=true
2622

2723
install:
2824
- pip install -q --use-mirrors nose python-dateutil numpy pep8 pyparsing pillow
2925
- sudo apt-get update && sudo apt-get -qq install inkscape libav-tools
26+
- if [[ $BUILD_DOCS == true ]]; then pip install sphinx numpydoc linkchecker; fi
3027
- python setup.py install
3128

3229
script:
33-
- mkdir ../tmp_test_dir
34-
- cd ../tmp_test_dir
3530
# The number of processes is hardcoded, because using too many causes the
3631
# Travis VM to run out of memory (since so many copies of inkscape and
3732
# ghostscript are running at the same time).
3833
- echo Testing using 8 processes
3934
# Generate the font caches in a single process before starting the
4035
# multiple processes
4136
- python -c "from matplotlib import font_manager"
42-
- python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300 $TEST_ARGS
37+
- if [[ $BUILD_DOCS == false ]]; then mkdir ../tmp_test_dir; fi
38+
- if [[ $BUILD_DOCS == false ]]; then cd ../tmp_test_dir; fi
39+
- if [[ $BUILD_DOCS == false ]]; then python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300 $TEST_ARGS; fi
40+
- if [[ $BUILD_DOCS == true ]]; then cd doc; python make.py html --small; fi
41+
# We don't build the LaTeX docs here, so linkchecker will complain
42+
- if [[ $BUILD_DOCS == true ]]; then touch build/html/Matplotlib.pdf; fi
43+
- if [[ $BUILD_DOCS == true ]]; then linkchecker build/html/index.html; fi
4344

4445
after_failure:
4546
- tar cjf result_images.tar.bz2 result_images
46-
- travis-artifacts upload --path result_images.tar.bz2
47-
- echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details."
48-
- echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2
47+
- if [[ $TRAVIS_PULL_REQUEST == false ]]; then gem install travis-artifacts; fi
48+
- if [[ $TRAVIS_PULL_REQUEST == false ]]; then travis-artifacts upload --path result_images.tar.bz2; fi
49+
- if [[ $TRAVIS_PULL_REQUEST != false ]]; then echo "The result images will only be uploaded if they are on the matplotlib/matplotlib repo - this is for security reasons to prevent arbitrary PRs echoing security details." else echo https://s3.amazonaws.com/matplotlib-test-results/artifacts/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/result_images.tar.bz2; fi

INSTALL

Lines changed: 102 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,36 @@ Installing
99
There are many different ways to install matplotlib, and the best way
1010
depends on what operating system you are using, what you already have
1111
installed, and how you want to use it. To avoid wading through all
12-
the details (and potential complications) on this page, the easiest
13-
thing for you to do is use one of the pre-packaged python
14-
distributions that already provide matplotlib built-in. The Enthought
15-
Python Distribution `(EPD)
16-
<http://www.enthought.com/products/epd.php>`_ for Windows, OS X or
17-
Redhat is an excellent choice that "just works" out of the box.
18-
Another excellent alternative for Windows users is `Python (x, y)
19-
<http://www.pythonxy.com/>`_ which tends to be updated a bit more
20-
frequently. Both of these packages include matplotlib and pylab, and
21-
*lots* of other useful tools. matplotlib is also packaged for almost
22-
every major Linux distribution. So if you are on Linux, your package
23-
manager will probably provide matplotlib prebuilt.
12+
the details (and potential complications) on this page, there are several
13+
convenient options.
2414

15+
Most platforms : scientific Python distributions
16+
================================================
17+
18+
The first option is to use one of the pre-packaged python distributions that
19+
already provide matplotlib built-in. The Continuum.io Python distribution
20+
`(Anaconda) <https://store.continuum.io/cshop/anaconda/>`_ and the Enthought
21+
distribution `(Canopy) <https://www.enthought.com/products/canopy/>`_ are both
22+
excellent choices that "just work" out of the box for Windows, OSX and common
23+
Linux platforms. Both of these distributions include matplotlib and *lots* of
24+
other useful tools. Another excellent alternative for Windows users is
25+
`Python (x, y) <https://code.google.com/p/pythonxy>`_ .
26+
27+
Linux : using your package manager
28+
==================================
29+
30+
If you are on Linux, you might prefer to use your package manager. matplotlib
31+
is packaged for almost every major Linux distribution.
32+
33+
* Debian / Ubuntu : ``sudo apt-get install python-matplotlib``
34+
* Fedora / Redhat : ``sudo yum install python-matplotlib``
35+
36+
Mac OSX - using pip
37+
===================
38+
39+
If you are on Mac OSX you can probably install matplotlib binaries using the
40+
standard Python installation program `pip <https://pypi.python.org/pip>`_.
41+
See :ref:`installing-osx-binaries`.
2542

2643
Manually installing pre-built packages
2744
======================================
@@ -36,7 +53,7 @@ on your machine, and if not, install it. The official python builds
3653
are available for download `here <http://www.python.org/download>`_,
3754
but OS X users please read :ref:`which-python-for-osx`.
3855

39-
Once you have python up and running, you will need to install `numpy
56+
Once you have Python up and running, you will need to install `numpy
4057
<http://www.numpy.org/>`_. numpy provides high-performance array data
4158
structures and mathematical functions, and is a requirement for
4259
matplotlib. You can test your progress::
@@ -90,28 +107,73 @@ toolkits and interactive settings that are discussed in
90107
Installing on Windows
91108
---------------------
92109

93-
If you don't already have python installed, you may want to consider
94-
using the Enthought edition of python, which has scipy, numpy, and
95-
wxpython, plus many other useful packages, preinstalled - `Enthought
96-
Python <http://www.enthought.com/python>`_. With the Enthought
97-
edition of python + matplotlib installer, the following backends
98-
should work out of the box: agg, wx, wxagg, tkagg, ps, pdf and svg.
99-
100-
For standard python installations, you will also need to install numpy
101-
in addition to the matplotlib installer. On some systems you will
102-
also need to download msvcp71.dll library, which you can download from
103-
http://www.dll-files.com/dllindex/dll-files.shtml?msvcp71 or other
104-
sites. You will need to unzip the archive and drag the dll into
105-
:file:`c:\windows\system32`.
106-
107-
All of the GUI backends run on Windows, but TkAgg is probably the
108-
best for interactive use from the standard python shell or ipython.
109-
The Windows installer (:file:`*.exe`) on the download page contains all the
110-
code you need to get up and running. However, there are many
111-
examples that are not included in the Windows installer. If you
112-
want to try the many demos that come in the matplotlib source
110+
If you don't already have Python installed, we recommend using
111+
one of the `scipy-stack compatible Python distributions
112+
<http://www.scipy.org/install.html>`_ such as Python(x,y),
113+
Enthought Canopy, or Continuum Anaconda, which have matplotlib and
114+
many of its dependencies, plus other useful packages, preinstalled.
115+
116+
For `standard Python <http://www.python.org/download/>`_ installations
117+
you will also need to install compatible versions of
118+
`setuptools <https://pypi.python.org/pypi/setuptools/>`_,
119+
`numpy <https://pypi.python.org/pypi/numpy/>`_,
120+
`python-dateutil <https://pypi.python.org/pypi/python-dateutil/>`_,
121+
`pytz <https://pypi.python.org/pypi/pytz>`_,
122+
`pyparsing <https://pypi.python.org/pypi/pyparsing/>`_ and
123+
`six <https://pypi.python.org/pypi/six>`_
124+
in addition to
125+
`matplotlib <https://pypi.python.org/pypi/matplotlib>`_.
126+
127+
In case Python is not installed for all users (not the default), the
128+
Microsoft Visual C++ 2008 (
129+
`64 bit <http://www.microsoft.com/download/en/details.aspx?id=15336>`_
130+
or
131+
`32 bit <http://www.microsoft.com/download/en/details.aspx?id=29>`_
132+
for Python 2.6 to 3.2) or Microsoft Visual C++ 2010 (
133+
`64 bit <http://www.microsoft.com/en-us/download/details.aspx?id=14632>`_
134+
or
135+
`32 bit <http://www.microsoft.com/en-us/download/details.aspx?id=5555>`_
136+
for Python 3.3 and 3.4) redistributable packages need to be installed.
137+
138+
Matplotlib depends on `Pillow <https://pypi.python.org/pypi/Pillow>`_
139+
for reading and saving JPEG, BMP, and TIFF image files.
140+
Matplotlib requires `MiKTeX <http://miktex.org/>`_ and
141+
`GhostScript <http://www.ghostscript.com/download/>`_ for rendering text
142+
with LaTeX.
143+
`FFmpeg <https://www.ffmpeg.org/>`_, `avconv <https://libav.org/>`_,
144+
`mencoder <http://www.mplayerhq.hu>`_, or
145+
`ImageMagick <http://www.imagemagick.org/>`_ are required for the
146+
animation module.
147+
148+
The following backends should work out of the box: agg, tkagg, ps,
149+
pdf and svg.
150+
For other backends you may need to install
151+
`pycairo <https://pypi.python.org/pypi/pycairo>`_,
152+
`PyQt4 <https://pypi.python.org/pypi/PyQt4>`_,
153+
`PyQt5 <https://pypi.python.org/pypi/PyQt5>`_,
154+
`PySide <https://pypi.python.org/pypi/PySide>`_,
155+
`wxPython <https://pypi.python.org/pypi/wxPython>`_,
156+
`PyGTK <https://pypi.python.org/pypi/PyGTK>`_,
157+
`Tornado <https://pypi.python.org/pypi/tornado>`_,
158+
or GhostScript.
159+
160+
TkAgg is probably the best backend for interactive use from the
161+
standard Python shell or IPython. It is enabled as the default backend
162+
for the official binaries. GTK3 is not supported on Windows.
163+
164+
The Windows installers (:file:`*.exe`) and wheels (:file:`*.whl`) on
165+
the download page do not contain test data or example code.
166+
If you want to try the many demos that come in the matplotlib source
113167
distribution, download the zip file and look in the :file:`examples`
114168
subdirectory.
169+
To run the test suite, copy the lib\matplotlib\tests and
170+
lib\mpl_toolkits\tests directories from the source distribution to
171+
sys.prefix\Lib\site-packages\matplotlib and
172+
sys.prefix\Lib\site-packages\mpl_toolkits respectively, and install
173+
`nose <https://pypi.python.org/pypi/nose>`_,
174+
`mock <https://pypi.python.org/pypi/mock>`_,
175+
Pillow, MiKTeX, GhostScript, ffmpeg, avconv, mencoder, ImageMagick, and
176+
`Inkscape <http://inkscape.org/>`_.
115177

116178
.. _install_from_source:
117179

@@ -161,7 +223,7 @@ manager on Linux, you may need to install the development packages
161223

162224
.. note::
163225

164-
If you are on debian/ubuntu, you can get all the dependencies
226+
If you are on Debian/Ubuntu, you can get all the dependencies
165227
required to build matplotlib with::
166228

167229
sudo apt-get build-dep python-matplotlib
@@ -198,6 +260,12 @@ six 1.3 or later
198260
Python 2/3 compatibility library. This is also a dependency of
199261
:term:`dateutil`.
200262

263+
libpng 1.2 (or later)
264+
library for loading and saving :term:`PNG` files (`download
265+
<http://www.libpng.org/pub/png/libpng.html>`__). libpng requires
266+
zlib. If you are a Windows user, you can ignore this because we
267+
build support into the matplotlib single-click installer
268+
201269

202270
**Optional GUI frameworks**
203271

@@ -241,13 +309,6 @@ ImageMagick
241309
user, you can ignore this since we build support into the
242310
matplotlib single click installer.
243311

244-
245-
libpng 1.2 (or later)
246-
library for loading and saving :term:`PNG` files (`download
247-
<http://www.libpng.org/pub/png/libpng.html>`__). libpng requires
248-
zlib. If you are a Windows user, you can ignore this because we
249-
build support into the matplotlib single-click installer
250-
251312
**Required libraries that ship with matplotlib**
252313

253314
:term:`agg` 2.4

README.osx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
Building mpl on OSX has proven to be a nightmare because of all the
1+
Building mpl on OSX is sometimes a nightmare because of all the
22
different types of zlib, png and freetype that may be on your system.
3-
The recommended and supported way to build is to use a third-party
4-
package manager to install the required dependencies, and then
5-
install matplotlib from source using the setup.py script. Two widely
6-
used package managers are homebrew and MacPorts. The following
7-
example illustrates how to install libpng and freetype using
8-
homebrew.
3+
4+
For developers who want to build matplotlib from source, the recommended and
5+
supported way to build is to use a third-party package manager to install the
6+
required dependencies, and then install matplotlib from source using the
7+
setup.py script. Two widely used package managers are homebrew, and
8+
MacPorts. The following example illustrates how to install libpng and freetype
9+
using brew:
910

1011
Example usage::
1112

@@ -22,3 +23,9 @@ To install matplotlib from source, execute:
2223
Example usage::
2324

2425
python setup.py install
26+
27+
28+
Note that your environment is somewhat important. Some conda users have
29+
found that, to run the tests, their PYTHONPATH must include
30+
/path/to/anaconda/.../site-packages and their DYLD_FALLBACK_LIBRARY_PATH
31+
must include /path/to/anaconda/lib.

0 commit comments

Comments
 (0)