Skip to content

Commit 786bab9

Browse files
committed
Merged from main/master
1 parent 09de6ad commit 786bab9

File tree

107 files changed

+40655
-6493
lines changed

Some content is hidden

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

107 files changed

+40655
-6493
lines changed

CHANGELOG

+40-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,46 @@
1+
2011-08-18 Change api of Axes.get_tightbbox and add an optional
2+
keyword parameter *call_axes_locator*. - JJL
3+
4+
2011-07-29 A new rcParam "axes.formatter.use_locale" was added, that,
5+
when True, will use the current locale to format tick
6+
labels. This means that, for example, in the fr_FR locale,
7+
',' will be used as a decimal separator. - MGD
8+
9+
2011-07-15 The set of markers available in the plot() and scatter()
10+
commands has been unified. In general, this gives more
11+
options to both than were previously available, however,
12+
there is one backward-incompatible change to the markers in
13+
scatter:
14+
15+
"d" used to mean "diamond", it now means "narrow
16+
diamond". "D" can be used for a "diamond".
17+
18+
-MGD
19+
20+
2011-07-13 Fix numerical problems in symlog scale, particularly when
21+
linthresh <= 1.0. Symlog plots may look different if one
22+
was depending on the old broken behavior - MGD
23+
24+
2011-07-10 Fixed argument handling error in tripcolor/triplot/tricontour,
25+
issue #203. - IMT
26+
27+
2011-07-08 Many functions added to mplot3d.axes3d to bring Axes3D
28+
objects more feature-parity with regular Axes objects.
29+
Significant revisions to the documentation as well.
30+
- BVR
31+
132
2011-06-28 3D versions of scatter, plot, plot_wireframe, plot_surface,
233
bar3d, and some other functions now support empty inputs. - BVR
334

4-
2011-06-16 Added *bottom* keyword parameter for the stem command.
5-
Also, implemented a legend handler for the stem plot.
35+
2011-06-22 Add set_theta_offset, set_theta_direction and
36+
set_theta_zero_location to polar axes to control the
37+
location of 0 and directionality of theta. - MGD
38+
39+
2011-06-22 Add axes.labelweight parameter to set font weight to axis
40+
labels - MGD.
41+
42+
2011-06-16 Added *bottom* keyword parameter for the stem command.
43+
Also, implemented a legend handler for the stem plot.
644
- JJL
745

846
2011-04-17 Disable keyboard auto-repeat in qt4 backend by ignoring

doc/_static/demo_mplot3d.png

42.2 KB
Loading

doc/_templates/indexsidebar.html

+8-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ <h3>News</h3>
55
to support matplotlib development.</p>
66

77

8-
<p>matplotlib 1.0.1 is available for <a href="https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/">download</a>. See <a href="{{ pathto('users/whats_new') }}">what's new</a> and tips on <a href="{{
9-
pathto('users/installing') }}">installing</a>
8+
<p>Matplotlib 1.1.0 is available for
9+
<a href="https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/">download</a>.
10+
See <a href="{{ pathto('users/whats_new') }}">what's new</a>
11+
and tips on <a href="{{ pathto('users/installing') }}">installing</a>.
1012
</p>
1113

1214
<p>Sandro Tosi has a new book
@@ -16,7 +18,7 @@ <h3>News</h3>
1618
at <a href="http://www.amazon.com/Matplotlib-Python-Developers-Sandro-Tosi/dp/1847197906">amazon</a>.</p>
1719

1820
<p>Build websites like matplotlib's,
19-
with <a href="http://sphinx.pocoo.org/">sphinx</a> and extensions for
21+
with <a href="http://sphinx.pocoo.org/">Sphinx</a> and extensions for
2022
mpl plots, math, inheritance diagrams -- try
2123
the <a href="http://matplotlib.sf.net/sampledoc">sampledoc</a>
2224
tutorial.
@@ -38,7 +40,7 @@ <h3>Videos</h3>
3840

3941
<h3>Toolkits</h3>
4042

41-
<p>There are several matplotlib addon <a href="{{
43+
<p>There are several matplotlib add-on <a href="{{
4244
pathto('users/toolkits') }}">toolkits</a>, including the projection
4345
and mapping toolkit
4446
<a href="http://matplotlib.sf.net/basemap/doc/html">basemap</a>, 3d plotting with <a href="{{
@@ -59,8 +61,8 @@ <h3>Need help?</h3>
5961
examples which exercise almost every corner of matplotlib.</p>
6062

6163
<p>You can file bugs, patches and feature requests on the
62-
sourceforge
63-
<a href="http://sourceforge.net/tracker2/?group_id=80706">tracker</a>,
64+
github
65+
<a href="https://github.com/matplotlib/matplotlib/issues?sort=created&direction=desc&state=open">tracker</a>,
6466
but it is a good idea to ping us on the mailing list too.</p>
6567

6668
<p>For details on what's new, see the detailed <a href="{{

doc/devel/coding_guide.rst

+12-23
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ in mind.
2323
* Can you pass :file:`examples/tests/backend_driver.py`? This is our
2424
poor man's unit test.
2525

26-
* Can you add a test to :file:`unit/nose_tests.py` to test your changes?
26+
* Can you add a test to :file:`lib/matplotlib/tests` to test your changes?
2727

2828
* If you have altered extension code, do you pass
2929
:file:`unit/memleak_hawaii3.py`?
@@ -33,7 +33,7 @@ in mind.
3333
:file:`MANIFEST.in`. This file determines what goes into the source
3434
distribution of the mpl build.
3535

36-
* Keep the maintenance branches and trunk in sync where it makes sense.
36+
* Keep the maintenance branches and master in sync where it makes sense.
3737

3838
Style guide
3939
===========
@@ -101,8 +101,8 @@ To detect and fix these and other whitespace errors (see below),
101101
use `reindent.py
102102
<http://svn.python.org/projects/doctools/trunk/utils/reindent.py>`_ as
103103
a command-line script. Unless you are sure your editor always
104-
does the right thing, please use reindent.py before checking changes into
105-
svn.
104+
does the right thing, please use reindent.py before committing your
105+
changes in git.
106106

107107
Keep docstrings_ uniformly indented as in the example below, with
108108
nothing to the left of the triple quotes. The
@@ -116,7 +116,7 @@ It may be preferable to use a temporary variable to replace a single
116116
long line with two shorter and more readable lines.
117117

118118
Please do not commit lines with trailing white space, as it causes
119-
noise in svn diffs. Tell your editor to strip whitespace from line
119+
noise in git diffs. Tell your editor to strip whitespace from line
120120
ends when saving a file. If you are an emacs user, the following in
121121
your ``.emacs`` will cause emacs to strip trailing white space upon
122122
saving for python, C and C++:
@@ -324,43 +324,32 @@ Writing examples
324324
================
325325

326326
We have hundreds of examples in subdirectories of
327-
file:`matplotlib/examples` in the trunk, and these are automatically
328-
generated when the website it built to show up both in the `examples
327+
file:`matplotlib/examples`, and these are automatically
328+
generated when the website is built to show up both in the `examples
329329
<http://matplotlib.sourceforge.net/examples/index.html>`_ and `gallery
330330
<http://matplotlib.sourceforge.net/gallery.html>`_ sections of the
331331
website. Many people find these examples from the website, and do not
332332
have ready access to the file:`examples` directory in which they
333333
reside. Thus any example data that is required for the example should
334-
be provided through the sample_data svn directory, which can then be
335-
accessed using :func:`matplotlib.cbook.get_sample_data`. First get a
336-
copy of the repository and svn add your data::
337-
338-
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/sample_data
339-
cp ~/path/to/mydata.dat sample_data/
340-
cd sample_data
341-
svn add mydata.dat
342-
svn commit -m 'added my data'
343-
344-
and then in your example code you can load it into a file handle with::
334+
be added to the `sample_data
335+
<https://github.com/matplotlib/sample_data>`_ git repository.
336+
Then in your example code you can load it into a file handle with::
345337

346338
import matplotlib.cbook as cbook
347339
fh = cbook.get_sample_data('mydata.dat')
348340

349-
The file will be fetched from the svn repo using urllib and updated
341+
The file will be fetched from the git repo using urllib and updated
350342
when the revision number changes.
351343

352344

353-
If you prefer just to get the full path to the file instead of an file
345+
If you prefer just to get the full path to the file instead of a file
354346
object::
355347

356348
import matplotlib.cbook as cbook
357349
datafile = cbook.get_sample_data('mydata.dat', asfileobj=False)
358350
print 'datafile', datafile
359351

360352

361-
362-
363-
364353
Testing
365354
=======
366355

doc/mpl_toolkits/mplot3d/api.rst

+42-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,60 @@
1+
.. _toolkit_mplot3d-api:
2+
13
***********
24
mplot3d API
35
***********
6+
.. contents::
7+
:backlinks: none
48

5-
:mod:`mpl_toolkits.mplot3d.axes3d`
6-
==================================
9+
.. _toolkit_mplot3d-axesapi:
10+
11+
:mod:`~mpl_toolkits.mplot3d.axes3d`
12+
===================================
13+
14+
.. note::
15+
Significant effort went into bringing axes3d to feature-parity with
16+
regular axes objects for version 1.1.0. However, more work remains.
17+
Please report any functions that do not behave as expected as a bug.
18+
In addition, help and patches would be greatly appreciated!
719

820
.. automodule:: mpl_toolkits.mplot3d.axes3d
921
:members:
1022
:show-inheritance:
1123

12-
:mod:`mpl_toolkits.mplot3d.art3d`
13-
=================================
1424

15-
.. automodule:: mpl_toolkits.mplot3d.art3d
25+
.. _toolkit_mplot3d-axisapi:
26+
27+
:mod:`~mpl_toolkits.mplot3d.axis3d`
28+
===================================
29+
30+
.. note::
31+
Historically, axis3d has suffered from having hard-coded constants
32+
controlling the look and feel of the 3D plot. This precluded user
33+
level adjustments such as label spacing, font colors and panel colors.
34+
For version 1.1.0, these constants have been consolidated into a single
35+
private member dictionary, `self._axinfo`, for the axis object. This is
36+
intended only as a stop-gap measure to allow user-level customization,
37+
but it is not intended to be permanent.
38+
39+
.. automodule:: mpl_toolkits.mplot3d.axis3d
1640
:members:
1741
:show-inheritance:
1842

19-
:mod:`mpl_toolkits.mplot3d.proj3d`
43+
.. _toolkit_mplot3d-artapi:
44+
45+
:mod:`~mpl_toolkits.mplot3d.art3d`
2046
==================================
2147

48+
.. automodule:: mpl_toolkits.mplot3d.art3d
49+
:members:
50+
:show-inheritance:
51+
52+
.. _toolkit_mplot3d-projapi:
53+
54+
:mod:`~mpl_toolkits.mplot3d.proj3d`
55+
===================================
56+
2257
.. automodule:: mpl_toolkits.mplot3d.proj3d
2358
:members:
2459
:show-inheritance:
60+

doc/mpl_toolkits/mplot3d/faq.rst

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.. _toolkit_mplot3d-faq:
2+
3+
***********
4+
mplot3d FAQ
5+
***********
6+
7+
How is mplot3d different from MayaVi?
8+
=====================================
9+
`MayaVi2 <http://code.enthought.com/projects/mayavi/documentation.php>`_
10+
is a very powerful and featureful 3D graphing library. For advanced
11+
3D scenes and excellent rendering capabilities, it is highly recomended to
12+
use MayaVi2.
13+
14+
mplot3d was intended to allow users to create simple 3D graphs with the same
15+
"look-and-feel" as matplotlib's 2D plots. Furthermore, users can use the same
16+
toolkit that they are already familiar with to generate both their 2D and 3D
17+
plots.
18+
19+
20+
My 3D plot doesn't look right at certain viewing angles
21+
=======================================================
22+
This is probably the most commonly reported issue with mplot3d. The problem
23+
is that -- from some viewing angles -- a 3D object would appear in front
24+
of another object, even though it is physically behind it. This can result in
25+
plots that do not look "physically correct."
26+
27+
Unfortunately, while some work is being done to reduce the occurance of this
28+
artifact, it is currently an intractable problem, and can not be fully solved
29+
until matplotlib supports 3D graphics rendering at its core.
30+
31+
The problem occurs due to the reduction of 3D data down to 2D + z-order
32+
scalar. A single value represents the 3rd dimension for all parts of 3D
33+
objects in a collection. Therefore, when the bounding boxes of two collections
34+
intersect, it becomes possible for this artifact to occur. Furthermore, the
35+
intersection of two 3D objects (such as polygons or patches) can not be
36+
rendered properly in matplotlib's 2D rendering engine.
37+
38+
This problem will likely not be solved until OpenGL support is added to all of
39+
the backends (patches are greatly welcomed). Until then, if you need complex
40+
3D scenes, we recommend using
41+
`MayaVi <http://code.enthought.com/projects/mayavi/documentation.php>`_.
42+
43+
44+
I don't like how the 3D plot is laid out, how do I change that?
45+
===============================================================
46+
Historically, mplot3d has suffered from a hard-coding of parameters used
47+
to control visuals such as label spacing, tick length, and grid line width.
48+
Work is being done to eliminate this issue. For matplotlib v1.1.0, there is
49+
a semi-official manner to modify these parameters. See the note in the
50+
:ref:`toolkit_mplot3d-axisapi` section of the mplot3d API documentation for
51+
more information.
52+

doc/mpl_toolkits/mplot3d/index.rst

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@ mplot3d
77

88
Matplotlib mplot3d toolkit
99
==========================
10-
The mplot3d toolkit adds simple 3d plotting capabilities to matplotlib by
11-
supplying an axis object that can create a 2d projection of a 3d scene.
12-
The resulting graph will have the same look and feel as regular 2d plots.
10+
The mplot3d toolkit adds simple 3D plotting capabilities to matplotlib by
11+
supplying an axes object that can create a 2D projection of a 3D scene.
12+
The resulting graph will have the same look and feel as regular 2D plots.
13+
14+
.. image:: ../../_static/demo_mplot3d.png
1315

1416
The interactive backends also provide the ability to rotate and zoom
15-
the 3d scene.
17+
the 3D scene. One can rotate the 3D scene by simply clicking-and-dragging
18+
the scene. Zooming is done by right-clicking the scene and dragging the
19+
mouse up and down. Note that one does not use the zoom button like one
20+
would use for regular 2D plots.
1621

1722
.. toctree::
1823
:maxdepth: 2
1924

2025
tutorial.rst
2126
api.rst
22-
27+
faq.rst

doc/mpl_toolkits/mplot3d/tutorial.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ add a new axes to it of type :class:`~mpl_toolkits.mplot3d.Axes3D`::
2222
ax = fig.add_subplot(111, projection='3d')
2323

2424
.. versionadded:: 1.0.0
25-
This approach is the preferred method of creating a 3d axes.
25+
This approach is the preferred method of creating a 3D axes.
2626

2727
.. note::
28-
Prior to version 1.0.0, the method of creating a 3d axes was
28+
Prior to version 1.0.0, the method of creating a 3D axes was
2929
different. For those using older versions of matplotlib, change
3030
``ax = fig.add_subplot(111, projection='3d')``
3131
to ``ax = Axes3D(fig)``.
@@ -121,12 +121,12 @@ Text
121121

122122
Subplotting
123123
====================
124-
Having multiple 3d plots in a single figure is the same
125-
as it is for 2d plots. Also, you can have both 2d and 3d plots
124+
Having multiple 3D plots in a single figure is the same
125+
as it is for 2D plots. Also, you can have both 2D and 3D plots
126126
in the same figure.
127127

128128
.. versionadded:: 1.0.0
129-
Subplotting 3d plots was added in v1.0.0. Earlier version can not
129+
Subplotting 3D plots was added in v1.0.0. Earlier version can not
130130
do this.
131131

132132
.. plot:: mpl_examples/mplot3d/subplot3d_demo.py

doc/pyplots/plotmap.py

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
14
try:
25
from mpl_toolkits.basemap import Basemap
3-
import matplotlib.pyplot as plt
4-
import numpy as np
6+
have_basemap = True
7+
except ImportError:
8+
have_basemap = False
9+
510

11+
def plotmap():
612
# create figure
713
fig = plt.figure(figsize=(8,8))
814
# set up orthographic map projection with
@@ -40,6 +46,16 @@
4046
# draw blue marble image in background.
4147
# (downsample the image by 50% for speed)
4248
map.bluemarble(scale=0.5)
43-
plt.show()
44-
except ImportError:
45-
pass
49+
50+
def plotempty():
51+
# create figure
52+
fig = plt.figure(figsize=(8,8))
53+
fig.text(0.5, 0.5, "Sorry, could not import Basemap",
54+
horizontalalignment='center')
55+
56+
if have_basemap:
57+
plotmap()
58+
else:
59+
plotempty()
60+
plt.show()
61+

doc/pyplots/tex_demo.png

-18.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)