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

Skip to content

Commit 097e325

Browse files
committed
updates to installing and interactive shell docs
svn path=/trunk/matplotlib/; revision=6213
1 parent a1bdd90 commit 097e325

6 files changed

Lines changed: 300 additions & 41 deletions

File tree

doc/_templates/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ <h1>Welcome</h1>
2222
matplotlib tries to make easy things easy and hard things possible.
2323
You can generate plots, histograms, power spectra, bar charts,
2424
errorcharts, scatterplots, etc, with just a few lines of code. For
25-
example, to make a histogram of data in x, you simply need to type
25+
example, to generate 10,000 gaussian random numbers and make a
26+
histogram plot binning the data into 100 bins, you simply need to type
2627

2728
<pre>
28-
>>> hist(x, 100) # use 100 bins
29+
>>> from pylab import randn, hist
30+
>>> x = randn(10000)
31+
>>> hist(x, 100)
2932
</pre>
3033

3134
For the power user, you have full control of line styles, font

doc/_templates/indexsidebar.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<h3>Download</h3>
22
<p>Current version: <b>{{ version }}</b></p>
3-
<p>Download matplotlib from the sourceforge <a
4-
href="http://sourceforge.net/projects/matplotlib">project</a> page.
3+
<p>Download matplotlib from the sourceforge <a
4+
href="http://sourceforge.net/projects/matplotlib">project</a> page
5+
(but first take a look at the <a
6+
href="{{ pathto('users/installing') }}">installing</a> page).
57

6-
There are also optional <a href="{{ pathto('users/toolkits') }}">toolkits</a> for matplotlib.
8+
<p>
9+
There are also optional <a href="{{ pathto('users/toolkits') }}">toolkits</a> for matplotlib.
10+
</p>
711

812
<h3>Need help?</h3>
9-
<p>Check the <a href="{{ pathto('contents') }}">docs</a>, the <a
13+
<p>Check the <a href="{{ pathto('contents') }}"}>docs</a>, the <a
1014
href="{{ pathto('faq/index') }}">faq</a>, and join the matplotlib mailing <a
1115
href="http://sourceforge.net/project/showfiles.php?group_id=80706">lists</a>
1216

@@ -20,5 +24,5 @@ <h3>Screenshots</h3>
2024
<a href="{{ pathto('users/screenshots') }}">screenshots</a> and <a href=examples>examples</a>
2125

2226

23-
27+
2428

doc/faq/installing_faq.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ install directory. To cleanly rebuild:
9090
<locating-matplotlib-install>`
9191

9292

93-
.. _install_svn:
93+
.. _install-svn:
9494

95-
How to install from svn
96-
=======================
95+
How to install from svn?
96+
========================
9797

9898
Checking out the main source::
9999

@@ -249,6 +249,21 @@ macros, and rename :cdata:`typename` parameter to :cdata:`typename_`::
249249
OS-X questions
250250
==============
251251

252+
.. _which-python-for-osx:
253+
254+
Which python for OS X?
255+
----------------------
256+
257+
Apple ships with its own python, many users have had trouble
258+
with it so there are alternatives. If it is feasible for you, we
259+
recommend the enthought python distribution `EPD
260+
<http://www.enthought.com/products/epd.php>`_ for OS X (which comes
261+
with matplotlib and much more) or the
262+
`MacPython <http://wiki.python.org/moin/MacPython/Leopard>`_ or the
263+
official OS X version from `python.org
264+
<http://www.python.org/download/>`_.
265+
266+
252267
.. _easy-install-osx-egg:
253268

254269
How can I easy_install my egg?

doc/users/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ User's Guide
1717
pyplot_tutorial.rst
1818
navigation_toolbar.rst
1919
customizing.rst
20+
shell.rst
2021
index_text.rst
2122
artists.rst
2223
event_handling.rst

doc/users/installing.rst

Lines changed: 125 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,112 @@
44
Installing
55
**********
66

7-
Dependencies
8-
============
9-
10-
**Requirements**
7+
There are lots of different ways to install matplotlib, and the best
8+
way depends on what operating system you are using, what you already
9+
have installed, and how you want to use it. To avoid wading through
10+
all the details (and potential complications) on this page, the
11+
easiest thing for you to do is use one of the pre-packaged python
12+
distributions that already provide matplotlib built in. The Enthought
13+
Python Distribution `(EPD)
14+
<http://www.enthought.com/products/epd.php>`_ for Windows, OS X or
15+
Redhat is an excellent choice that "just works" out of the box.
16+
Another excellent alternative for Windows users is `Python (x, y)
17+
<http://www.pythonxy.com/foreword.php>`_ which tends to be updated a
18+
bit more frequently. Both of these packages include matplotlib and
19+
pylab, and *lots* of other useful tools. matplotlib is also packaged
20+
for pretty much every major linux distribution, so if you are on linux
21+
your package manager will probably provide matplotlib prebuilt.
22+
23+
One single click installer and you are done.
24+
25+
Ok, so you want to do it the hard way?
26+
======================================
27+
28+
For some people, the prepackaged pythons discussed above are not an
29+
option. That's OK, it's usually pretty easy to get a custom install
30+
working. You will first need to find out if you have python installed
31+
on your machine, and if not, install it. The official python builds
32+
are available for download `here <http://www.python.org/download>`_,
33+
but OS X users please read :ref:`which-python-for-osx`.
34+
35+
Once you have python up and running, you will need to install `numpy
36+
<http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103>`_.
37+
numpy provides high performance array data structures and mathematical
38+
functions, and is a requirement for matplotlib. You can test your
39+
progress::
40+
41+
>>> import numpy
42+
>>> print numpy.__versions__
43+
44+
matplotlib requires numpy version 1.1 or later. Although it is not a
45+
requirement to use matplotlib, we strongly encourage you to install
46+
`ipython <http://ipython.scipy.org/dist>`_, which is an interactive
47+
shell for python that is matplotlib aware. Once you have ipython,
48+
numpy and matplotlib installed, ipython's "pylab" mode you have a
49+
matlab-like environment that automatically handles most of the
50+
configuration details for you, so you can get up and running quickly::
51+
52+
johnh@flag:~> ipython -pylab
53+
Python 2.4.5 (#4, Apr 12 2008, 09:09:16)
54+
IPython 0.9.0 -- An enhanced Interactive Python.
55+
56+
Welcome to pylab, a matplotlib-based Python environment.
57+
For more information, type 'help(pylab)'.
58+
59+
In [1]: x = randn(10000)
60+
61+
In [2]: hist(x, 100)
62+
63+
And a *voila*, a figure pops up. But we are putting the cart ahead of
64+
the horse -- first we need to get matplotlib installed. We provide
65+
prebuilt binaries for OS X and Windows on the matplotlib `download
66+
<http://sourceforge.net/project/showfiles.php?group_id=80706>`_ page.
67+
Click on the latest release of the "matplotlib" package, choose your
68+
python version (2.4 or 2.5) and your platform (macosx or win32) and
69+
you should be good to go. If you have any problems, please check the
70+
:ref:`installing-faq`, google around a little bit, and post a question
71+
the `mailing list
72+
<http://sourceforge.net/project/showfiles.php?group_id=80706>`_.
73+
74+
Note that when testing matplotlib installations from the interactive
75+
python console, there are some issues relating to user interface
76+
toolkits and interactive settings that are discussed in
77+
:ref:`mpl-shell`.
78+
79+
.. _install_from_source:
80+
81+
Installing from source
82+
======================
83+
84+
If you are interested perhaps in contributing to matplotlib
85+
development, or just like to build everything yourself, it is not
86+
difficult to build matplotlib from source. Grab the lattest *tar.gz*
87+
release file from `sourceforge
88+
<http://sourceforge.net/project/showfiles.php?group_id=80706>`_, or if
89+
you want to develop matplotlib or just need the latest bugfixed
90+
version, grab the latest svn version :ref:`install-svn`.
91+
92+
Once you have satisfied the requirements detailed below (mainly
93+
python, numpy, libpng and freetype), you build matplotlib in the usual
94+
way::
95+
96+
cd matplotlib
97+
python setup.py build
98+
python setup.py install
99+
100+
We provide a `setup.cfg
101+
<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/setup.cfg.template?view=markup>`
102+
file that lives along :file:`setup.py` which you can use to customize
103+
the build process, for example, which default backend to use, whether
104+
some of the optional libraries that matplotlib ships with are
105+
installed, and so on. This file will be particularly useful to those
106+
packaging matplotlib.
107+
108+
109+
.. _install_requrements:
110+
111+
Build requirements
112+
==================
11113

12114
These are external packages which you will need to install before
13115
installing matplotlib. Windows users only need the first two (python
@@ -18,12 +120,14 @@ installers available for download at the sourceforge site.
18120
matplotlib requires python 2.4 or later (`download <http://www.python.org/download/>`__)
19121

20122
:term:`numpy` 1.1 (or later)
21-
array support for python (`download <http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103>`__)
123+
array support for python (`download
124+
<http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103>`__)
22125

23126
libpng 1.1 (or later)
24-
library for loading and saving :term:`PNG` files (`download <http://www.libpng.org/pub/png/libpng.html>`__). libpng requires zlib. If
25-
you are a windows user, you can ignore this since we build support
26-
into the matplotlib single click installer
127+
library for loading and saving :term:`PNG` files (`download
128+
<http://www.libpng.org/pub/png/libpng.html>`__). libpng requires
129+
zlib. If you are a windows user, you can ignore this since we
130+
build support into the matplotlib single click installer
27131

28132
:term:`freetype` 1.4 (or later)
29133
library for reading true type font files. If you are a windows
@@ -60,32 +164,22 @@ backends and the capabilities they provide
60164

61165
**Required libraries that ship with matplotlib**
62166

63-
If you are downloading matplotlib or installing from source or
64-
subversion, you can ignore this section. This is useful for matplotlib
65-
developers and packagers who may want to disable the matplotlib
66-
version and ship a packaged version.
67-
68167
:term:`agg` 2.4
69-
The antigrain C++ rendering engine
168+
The antigrain C++ rendering engine. matplotlib links against the
169+
agg template source statically, so it will not affect anything on
170+
your system outside of matplotlib.
70171

71172
pytz 2007g or later
72-
timezone handling for python datetime objects
173+
timezone handling for python datetime objects. By default,
174+
matplotlib will install pytz if it isn't already installed on your
175+
system. To override the default, use setup.cfg to force or
176+
prevent installation of pytz.
73177

74178
dateutil 1.1 or later
75-
extensions to python datetime handling
76-
77-
**Optional libraries that ship with matplotlib**
78-
79-
As above, if you are downloading matplotlib or installing from source
80-
or subversion, you can ignore this section. This is useful for
81-
matplotlib developers and packagers who may want to disable the
82-
matplotlib version and ship a packaged version.
83-
84-
enthought traits 2.6
85-
The traits component of the Enthought Tool Suite used in the
86-
experimental matplotlib traits rc system. matplotlib has decided
87-
to stop installing this library so packagers should not distribute
88-
the version included with matplotlib. packagers do not need to
89-
list this as a requirement because the traits support is
90-
experimental and disabled by default.
179+
extensions to python datetime handling. By
180+
default, matplotlib will install dateutil if it isn't already
181+
installed on your system. To override the default, use setup.cfg
182+
to force or prevent installation of dateutil.
183+
184+
91185

0 commit comments

Comments
 (0)