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

Skip to content

Commit 65f366f

Browse files
committed
moved intro into separate doc
svn path=/trunk/matplotlib/; revision=5368
1 parent 1441d2b commit 65f366f

5 files changed

Lines changed: 122 additions & 89 deletions

File tree

doc/devel/coding_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ emacs to strip trailing white space upon saving for python, C and C++:
172172
(lambda ()
173173
(add-hook 'write-file-functions 'delete-trailing-whitespace)))
174174
175-
for older versions of emacs (emacs<22) you need to do:
175+
for older versions of emacs (emacs<22) you need to do:
176176

177177
.. code-block:: cl
178178

doc/faq/installing_faq.rst

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Unfortunately::
1919
does not properly clean the build directory, and does nothing to the
2020
install directory. To cleanly rebuild:
2121

22-
* delete the ``build`` directory in the source tree
22+
* delete the ``build`` directory in the source tree
2323
* delete ``site-packages/matplotlib`` directory in the Python
2424
installation. The location of ``site-packages`` is
2525
platform-specific. You can find out where matplotlib is installed by doing::
@@ -63,7 +63,7 @@ There are a two primary ways to configure your backend. One is to set
6363
the ``backend`` parameter in you ``matplotlibrc`` file (see
6464
:ref:`customizing-matplotlib`)::
6565

66-
backend : WXAgg # use wxpython with antigrain (agg) rendering
66+
backend : WXAgg # use wxpython with antigrain (agg) rendering
6767

6868
The other is to use the matplotlib :func:`~matplotlib.use` directive::
6969

@@ -74,7 +74,7 @@ If you use the ``use`` directive, this must be done before importing
7474
:mod:`matplotlib.pyplot` or :mod:`matplotlib.pylab`.
7575

7676
If you are unsure what to do, and just want to get cranking, just set
77-
your backend to `TkAgg`. This will do the right thing for 95% of the
77+
your backend to ``TkAgg``. This will do the right thing for 95% of the
7878
users. It gives you the option of running your scripts in batch or
7979
working interactively from the python shell, with the least amount of
8080
hassles, and is smart enough to do the right thing when you ask for
@@ -100,7 +100,8 @@ from this point to this point" and hence are scale free, and raster
100100
backends generate a pixel represenation of the line whose accuracy
101101
depends on a DPI setting.
102102

103-
Here is a summary of the matplotlib rendering backends:
103+
Here is a summary of the matplotlib renders (there is an eponymous
104+
backed for each):
104105

105106
=============================== =====================================================================================
106107
Renderer (Filetypes) Description
@@ -116,7 +117,7 @@ GDK (png, jpg, tiff..) raster - the GDK drawing API for GTK
116117
And here are the user interfaces and renderer combinations supported:
117118

118119
============ ===================================================================================================
119-
Backend Description
120+
Backend Description
120121
============ ===================================================================================================
121122
GTKAgg Agg rendering to a GTK canvas (`pygtk <http://www.pygtk.org>`_)
122123
GTK GDK rendering to a GTK canvas (not recommended) (`pygtk <http://www.pygtk.org>`_)
@@ -129,3 +130,30 @@ Qt4Agg Agg rendering to a Qt4 canvas (`pyqt <http://www.riverbankcomputi
129130
FLTKAgg Agg rendering to a FLTK canvas (`pyfltk <http://pyfltk.sourceforge.net>`)_
130131
============ ===================================================================================================
131132

133+
134+
OS X Questions
135+
==============
136+
137+
.. _easy-install-osx-egg:
138+
139+
How can I easy_install my egg?
140+
------------------------------
141+
142+
I downloaded the egg for 0.98 from the matplotlib webpages,
143+
and I am trying to ``easy_install`` it, but I am getting an error::
144+
145+
> easy_install ./matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg
146+
Processing matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg
147+
removing '/Library/Python/2.5/site-packages/matplotlib-0.98.0-py2.5-
148+
...snip...
149+
Reading http://matplotlib.sourceforge.net
150+
Reading http://cheeseshop.python.org/pypi/matplotlib/0.91.3
151+
No local packages or download links found for matplotlib==0.98.0
152+
error: Could not find suitable distribution for
153+
Requirement.parse('matplotlib==0.98.0')
154+
155+
If you rename ``matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg`` to
156+
``matplotlib-0.98.0-py2.5.egg``, ``easy_install`` will install it from
157+
the disk. Many Mac OS X eggs with cruft at the end of the filename,
158+
which prevents their installation through easy_install. Renaming is
159+
all it takes to install them; still, it's annoying.

doc/faq/troubleshooting_faq.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ tracker only periodically. If your problem has been determined to be
6363
a bug and can not be quickly solved, you may be asked to file a bug in
6464
the tracker so the issue doesn't get lost.
6565

66+

doc/users/index.rst

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
.. toctree::
1111

12+
intro.rst
1213
pyplot_tutorial.rst
1314
mathtext.rst
1415
navigation_toolbar.rst
@@ -17,86 +18,3 @@
1718
event_handling.rst
1819

1920

20-
matplotlib is a library for making 2D plots of arrays in `Python
21-
<http://www.python.org>`_. Although it has its origins in emulating
22-
the `MATLAB™ <http://www.mathworks.com>`_ graphics commands, it does
23-
not require MATLAB, and can be used in a Pythonic, object oriented
24-
way. Although matplotlib is written primarily in pure Python, it
25-
makes heavy use of `NumPy <http://www.numpy.org>`_ and other extension
26-
code to provide good performance even for large arrays.
27-
28-
matplotlib is designed with the philosophy that you should be able to
29-
create simple plots with just a few commands, or just one! If you
30-
want to see a histogram of your data, you shouldn't need to
31-
instantiate objects, call methods, set properties, and so on; it
32-
should just work.
33-
34-
For years, I used to use MATLAB exclusively for data analysis and
35-
visualization. MATLAB excels at making nice looking plots easy. When
36-
I began working with EEG data, I found that I needed to write
37-
applications to interact with my data, and developed and EEG analysis
38-
application in MATLAB. As the application grew in complexity,
39-
interacting with databases, http servers, manipulating complex data
40-
structures, I began to strain against the limitations of MATLAB as a
41-
programming language, and decided to start over in Python. Python
42-
more than makes up for all of MATLAB's deficiencies as a programming
43-
language, but I was having difficulty finding a 2D plotting package
44-
(for 3D `VTK <http://www.vtk.org/>`_) more than exceeds all of my needs).
45-
46-
When I went searching for a Python plotting package, I had several
47-
requirements:
48-
49-
* Plots should look great - publication quality. One important
50-
requirement for me is that the text looks good (antialiased, etc.)
51-
52-
* Postscript output for inclusion with TeX documents
53-
54-
* Embeddable in a graphical user interface for application
55-
development
56-
57-
* Code should be easy enough that I can understand it and extend
58-
it
59-
60-
* Making plots should be easy
61-
62-
Finding no package that suited me just right, I did what any
63-
self-respecting Python programmer would do: rolled up my sleeves and
64-
dived in. Not having any real experience with computer graphics, I
65-
decided to emulate MATLAB's plotting capabilities because that is
66-
something MATLAB does very well. This had the added advantage that
67-
many people have a lot of MATLAB experience, and thus they can
68-
quickly get up to steam plotting in python. From a developer's
69-
perspective, having a fixed user interface (the pylab interface) has
70-
been very useful, because the guts of the code base can be redesigned
71-
without affecting user code.
72-
73-
The matplotlib code is conceptually divided into three parts: the
74-
*pylab interface* is the set of functions provided by
75-
:mod:`matplotlib.pylab` which allow the user to create plots with code
76-
quite similar to MATLAB figure generating code. The *matplotlib
77-
frontend* or *matplotlib API* is the set of classes that do the heavy
78-
lifting, creating and managing figures, text, lines, plots and so on.
79-
This is an abstract interface that knows nothing about output. The
80-
*backends* are device dependent drawing devices, aka renderers, that
81-
transform the frontend representation to hardcopy or a display device.
82-
Example backends: PS creates `PostScript®
83-
<http://http://www.adobe.com/products/postscript/>`_ hardcopy, SVG
84-
creates `Scalable Vector Graphics <http://www.w3.org/Graphics/SVG/>`_
85-
hardcopy, Agg creates PNG output using the high quality `Anti-Grain
86-
Geometry <http://www.antigrain.com>`_ library that ships with
87-
matplotlib, GTK embeds matplotlib in a `Gtk+ <http://www.gtk.org/>`_
88-
application, GTKAgg uses the Anti-Grain renderer to create a figure
89-
and embed it a Gtk+ application, and so on for `PDF
90-
<http://www.adobe.com/products/acrobat/adobepdf.html>`_, `WxWidgets
91-
<http://www.wxpython.org/>`_, `Tkinter
92-
<http://docs.python.org/lib/module-Tkinter.html>`_ etc.
93-
94-
matplotlib is used by many people in many different contexts. Some
95-
people want to automatically generate PostScript® files to send
96-
to a printer or publishers. Others deploy matplotlib on a web
97-
application server to generate PNG output for inclusion in
98-
dynamically-generated web pages. Some use matplotlib interactively
99-
from the Python shell in Tkinter on Windows™. My primary use is to
100-
embed matplotlib in a Gtk+ EEG application that runs on Windows, Linux
101-
and Macintosh OS X.
102-

doc/users/intro.rst

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
Introduction
2+
============
3+
4+
matplotlib is a library for making 2D plots of arrays in `Python
5+
<http://www.python.org>`_. Although it has its origins in emulating
6+
the `MATLAB™ <http://www.mathworks.com>`_ graphics commands, it does
7+
not require MATLAB, and can be used in a Pythonic, object oriented
8+
way. Although matplotlib is written primarily in pure Python, it
9+
makes heavy use of `NumPy <http://www.numpy.org>`_ and other extension
10+
code to provide good performance even for large arrays.
11+
12+
matplotlib is designed with the philosophy that you should be able to
13+
create simple plots with just a few commands, or just one! If you
14+
want to see a histogram of your data, you shouldn't need to
15+
instantiate objects, call methods, set properties, and so on; it
16+
should just work.
17+
18+
For years, I used to use MATLAB exclusively for data analysis and
19+
visualization. MATLAB excels at making nice looking plots easy. When
20+
I began working with EEG data, I found that I needed to write
21+
applications to interact with my data, and developed and EEG analysis
22+
application in MATLAB. As the application grew in complexity,
23+
interacting with databases, http servers, manipulating complex data
24+
structures, I began to strain against the limitations of MATLAB as a
25+
programming language, and decided to start over in Python. Python
26+
more than makes up for all of MATLAB's deficiencies as a programming
27+
language, but I was having difficulty finding a 2D plotting package
28+
(for 3D `VTK <http://www.vtk.org/>`_) more than exceeds all of my needs).
29+
30+
When I went searching for a Python plotting package, I had several
31+
requirements:
32+
33+
* Plots should look great - publication quality. One important
34+
requirement for me is that the text looks good (antialiased, etc.)
35+
36+
* Postscript output for inclusion with TeX documents
37+
38+
* Embeddable in a graphical user interface for application
39+
development
40+
41+
* Code should be easy enough that I can understand it and extend
42+
it
43+
44+
* Making plots should be easy
45+
46+
Finding no package that suited me just right, I did what any
47+
self-respecting Python programmer would do: rolled up my sleeves and
48+
dived in. Not having any real experience with computer graphics, I
49+
decided to emulate MATLAB's plotting capabilities because that is
50+
something MATLAB does very well. This had the added advantage that
51+
many people have a lot of MATLAB experience, and thus they can
52+
quickly get up to steam plotting in python. From a developer's
53+
perspective, having a fixed user interface (the pylab interface) has
54+
been very useful, because the guts of the code base can be redesigned
55+
without affecting user code.
56+
57+
The matplotlib code is conceptually divided into three parts: the
58+
*pylab interface* is the set of functions provided by
59+
:mod:`matplotlib.pylab` which allow the user to create plots with code
60+
quite similar to MATLAB figure generating code. The *matplotlib
61+
frontend* or *matplotlib API* is the set of classes that do the heavy
62+
lifting, creating and managing figures, text, lines, plots and so on.
63+
This is an abstract interface that knows nothing about output. The
64+
*backends* are device dependent drawing devices, aka renderers, that
65+
transform the frontend representation to hardcopy or a display device.
66+
Example backends: PS creates `PostScript®
67+
<http://http://www.adobe.com/products/postscript/>`_ hardcopy, SVG
68+
creates `Scalable Vector Graphics <http://www.w3.org/Graphics/SVG/>`_
69+
hardcopy, Agg creates PNG output using the high quality `Anti-Grain
70+
Geometry <http://www.antigrain.com>`_ library that ships with
71+
matplotlib, GTK embeds matplotlib in a `Gtk+ <http://www.gtk.org/>`_
72+
application, GTKAgg uses the Anti-Grain renderer to create a figure
73+
and embed it a Gtk+ application, and so on for `PDF
74+
<http://www.adobe.com/products/acrobat/adobepdf.html>`_, `WxWidgets
75+
<http://www.wxpython.org/>`_, `Tkinter
76+
<http://docs.python.org/lib/module-Tkinter.html>`_ etc.
77+
78+
matplotlib is used by many people in many different contexts. Some
79+
people want to automatically generate PostScript® files to send
80+
to a printer or publishers. Others deploy matplotlib on a web
81+
application server to generate PNG output for inclusion in
82+
dynamically-generated web pages. Some use matplotlib interactively
83+
from the Python shell in Tkinter on Windows™. My primary use is to
84+
embed matplotlib in a Gtk+ EEG application that runs on Windows, Linux
85+
and Macintosh OS X.
86+

0 commit comments

Comments
 (0)