Revision: 7434
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7434&view=rev
Author: efiring
Date: 2009-08-08 18:24:52 +0000 (Sat, 08 Aug 2009)
Log Message:
-----------
Merged revisions 7428-7433 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint
........
r7428 | jdh2358 | 2009-08-08 02:21:29 -1000 (Sat, 08 Aug 2009) | 1 line
clean up mplot3d examples: use pyplot noy pylab and numpy rather than list
comps and python random module
........
r7429 | jdh2358 | 2009-08-08 03:53:24 -1000 (Sat, 08 Aug 2009) | 1 line
two new examples using a compund path for a histogram; one animated
........
r7430 | jdh2358 | 2009-08-08 03:58:52 -1000 (Sat, 08 Aug 2009) | 1 line
two new examples using a compund path for a histogram; one animated
........
r7431 | jdh2358 | 2009-08-08 05:10:08 -1000 (Sat, 08 Aug 2009) | 1 line
use a class helper method to make the compound path from polys
........
r7432 | jdh2358 | 2009-08-08 05:16:57 -1000 (Sat, 08 Aug 2009) | 1 line
simplify poly array in example
........
r7433 | efiring | 2009-08-08 08:16:01 -1000 (Sat, 08 Aug 2009) | 2 lines
Fix excessive line length in annotations.rst
........
Modified Paths:
--------------
trunk/matplotlib/doc/users/annotations.rst
trunk/matplotlib/examples/mplot3d/2dcollections3d_demo.py
trunk/matplotlib/examples/mplot3d/bars3d_demo.py
trunk/matplotlib/examples/mplot3d/contour3d_demo.py
trunk/matplotlib/examples/mplot3d/contour3d_demo2.py
trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
trunk/matplotlib/examples/mplot3d/hist3d_demo.py
trunk/matplotlib/examples/mplot3d/lines3d_demo.py
trunk/matplotlib/examples/mplot3d/polys3d_demo.py
trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
trunk/matplotlib/examples/mplot3d/surface3d_demo.py
trunk/matplotlib/examples/mplot3d/surface3d_demo2.py
trunk/matplotlib/examples/mplot3d/text3d_demo.py
trunk/matplotlib/examples/mplot3d/wire3d_demo.py
trunk/matplotlib/lib/matplotlib/path.py
Added Paths:
-----------
trunk/matplotlib/examples/animation/histogram_tkagg.py
trunk/matplotlib/examples/api/histogram_path_demo.py
Property Changed:
----------------
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
trunk/matplotlib/doc/sphinxext/gen_gallery.py
trunk/matplotlib/doc/sphinxext/gen_rst.py
trunk/matplotlib/examples/misc/multiprocess.py
trunk/matplotlib/examples/mplot3d/contour3d_demo.py
trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
trunk/matplotlib/examples/mplot3d/polys3d_demo.py
trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
trunk/matplotlib/examples/mplot3d/surface3d_demo.py
trunk/matplotlib/examples/mplot3d/wire3d_demo.py
trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253
/branches/v0_99_maint:1-7426
+ /branches/mathtex:1-7263 /branches/v0_98_5_maint:1-7253
/branches/v0_99_maint:1-7433
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint:7338,7393,7395-7404,7407-7424,7428-7433
Property changes on: trunk/matplotlib/doc/pyplots/README
___________________________________________________________________
Modified: svn:mergeinfo
-
/branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424
+
/branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/pyplots/README:7338,7393,7395-7404,7407-7424,7428-7433
Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_gallery.py:7338,7393,7395-7404,7407-7424,7428-7433
Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/doc/sphinxext/gen_rst.py:7338,7393,7395-7404,7407-7424,7428-7433
Modified: trunk/matplotlib/doc/users/annotations.rst
===================================================================
--- trunk/matplotlib/doc/users/annotations.rst 2009-08-08 18:16:01 UTC (rev
7433)
+++ trunk/matplotlib/doc/users/annotations.rst 2009-08-08 18:24:52 UTC (rev
7434)
@@ -56,17 +56,20 @@
properties in the optional keyword argument ``arrowprops``.
-====================
===========================================================================
+==================== =====================================================
``arrowprops`` key description
-====================
===========================================================================
+==================== =====================================================
width the width of the arrow in points
frac the fraction of the arrow length occupied by the head
headwidth the width of the base of the arrow head in points
-shrink move the tip and base some percent away from the
annotated point and text
-\*\*kwargs any key for :class:`matplotlib.patches.Polygon`, eg
``facecolor``
-====================
===========================================================================
+shrink move the tip and base some percent away from
+ the annotated point and text
+\*\*kwargs any key for :class:`matplotlib.patches.Polygon`,
+ e.g. ``facecolor``
+==================== =====================================================
+
In the example below, the ``xy`` point is in native coordinates
(``xycoords`` defaults to 'data'). For a polar axes, this is in
(theta, radius) space. The text in this example is placed in the
@@ -78,4 +81,7 @@
.. plot:: pyplots/annotation_polar.py
:include-source:
-For more on all the wild and wonderful things you can do with annotations,
including fancy arrows, see :ref:`plotting-guide-annotation` and
:ref:`pylab_examples-annotation_demo`.
+For more on all the wild and wonderful things you can do with
+annotations, including fancy arrows, see :ref:`plotting-guide-annotation`
+and :ref:`pylab_examples-annotation_demo`.
+
Copied: trunk/matplotlib/examples/animation/histogram_tkagg.py (from rev 7433,
branches/v0_99_maint/examples/animation/histogram_tkagg.py)
===================================================================
--- trunk/matplotlib/examples/animation/histogram_tkagg.py
(rev 0)
+++ trunk/matplotlib/examples/animation/histogram_tkagg.py 2009-08-08
18:24:52 UTC (rev 7434)
@@ -0,0 +1,70 @@
+"""
+This example shows how to use a path patch to draw a bunch of
+rectangles for an animated histogram
+"""
+import time
+import numpy as np
+import matplotlib
+matplotlib.use('TkAgg') # do this before importing pylab
+
+import matplotlib.pyplot as plt
+import matplotlib.patches as patches
+import matplotlib.path as path
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+# histogram our data with numpy
+data = np.random.randn(1000)
+n, bins = np.histogram(data, 100)
+
+# get the corners of the rectangles for the histogram
+left = np.array(bins[:-1])
+right = np.array(bins[1:])
+bottom = np.zeros(len(left))
+top = bottom + n
+nrects = len(left)
+
+# here comes the tricky part -- we have to set up the vertex and path
+# codes arrays using moveto, lineto and closepoly
+
+# for each rect: 1 for the MOVETO, 3 for the LINETO, 1 for the
+# CLOSEPOLY; the vert for the closepoly is ignored but we still need
+# it to keep the codes aligned with the vertices
+nverts = nrects*(1+3+1)
+verts = np.zeros((nverts, 2))
+codes = np.ones(nverts, int) * path.Path.LINETO
+codes[0::5] = path.Path.MOVETO
+codes[4::5] = path.Path.CLOSEPOLY
+verts[0::5,0] = left
+verts[0::5,1] = bottom
+verts[1::5,0] = left
+verts[1::5,1] = top
+verts[2::5,0] = right
+verts[2::5,1] = top
+verts[3::5,0] = right
+verts[3::5,1] = bottom
+
+barpath = path.Path(verts, codes)
+patch = patches.PathPatch(barpath, facecolor='green', edgecolor='yellow',
alpha=0.5)
+ax.add_patch(patch)
+
+ax.set_xlim(left[0], right[-1])
+ax.set_ylim(bottom.min(), top.max())
+
+def animate():
+ if animate.cnt>=100:
+ return
+
+ animate.cnt += 1
+ # simulate new data coming in
+ data = np.random.randn(1000)
+ n, bins = np.histogram(data, 100)
+ top = bottom + n
+ verts[1::5,1] = top
+ verts[2::5,1] = top
+ fig.canvas.draw()
+ fig.canvas.manager.window.after(100, animate)
+animate.cnt = 0
+fig.canvas.manager.window.after(100, animate)
+plt.show()
Copied: trunk/matplotlib/examples/api/histogram_path_demo.py (from rev 7433,
branches/v0_99_maint/examples/api/histogram_path_demo.py)
===================================================================
--- trunk/matplotlib/examples/api/histogram_path_demo.py
(rev 0)
+++ trunk/matplotlib/examples/api/histogram_path_demo.py 2009-08-08
18:24:52 UTC (rev 7434)
@@ -0,0 +1,47 @@
+"""
+This example shows how to use a path patch to draw a bunch of
+rectangles. The technique of using lots of Rectangle instances, or
+the faster method of using PolyCollections, were implemented before we
+had proper paths with moveto/lineto, closepoly etc in mpl. Now that
+we have them, we can draw collections of regularly shaped objects with
+homogeous properties more efficiently with a PathCollection. This
+example makes a histogram -- its more work to set up the vertex arrays
+at the outset, but it should be much faster for large numbers of
+objects
+"""
+
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.patches as patches
+import matplotlib.path as path
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+# histogram our data with numpy
+data = np.random.randn(1000)
+n, bins = np.histogram(data, 50)
+
+# get the corners of the rectangles for the histogram
+left = np.array(bins[:-1])
+right = np.array(bins[1:])
+bottom = np.zeros(len(left))
+top = bottom + n
+
+
+# we need a (numrects x numsides x 2) numpy array for the path helper
+# function to build a compound path
+XY = np.array([[left,left,right,right], [bottom,top,top,bottom]]).T
+
+# get the Path object
+barpath = path.Path.make_compound_path_from_polys(XY)
+
+# make a patch out of it
+patch = patches.PathPatch(barpath, facecolor='blue', edgecolor='gray',
alpha=0.8)
+ax.add_patch(patch)
+
+# update the view limits
+ax.set_xlim(left[0], right[-1])
+ax.set_ylim(bottom.min(), top.max())
+
+plt.show()
Property changes on: trunk/matplotlib/examples/misc/multiprocess.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/misc/multiprocess.py:7338,7393,7395-7404,7407-7424,7428-7433
Modified: trunk/matplotlib/examples/mplot3d/2dcollections3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/2dcollections3d_demo.py 2009-08-08
18:16:01 UTC (rev 7433)
+++ trunk/matplotlib/examples/mplot3d/2dcollections3d_demo.py 2009-08-08
18:24:52 UTC (rev 7434)
@@ -1,8 +1,8 @@
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
-import pylab
+import matplotlib.pyplot as plt
-fig = pylab.figure()
+fig = plt.figure()
ax = Axes3D(fig)
x = np.linspace(0, 1, 100)
@@ -20,5 +20,5 @@
ax.set_ylim3d(0, 1)
ax.set_zlim3d(0, 1)
-pylab.show()
+plt.show()
Modified: trunk/matplotlib/examples/mplot3d/bars3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/bars3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/bars3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,20 +1,17 @@
from mpl_toolkits.mplot3d import Axes3D
-from matplotlib.collections import PolyCollection
-from matplotlib.colors import colorConverter
-import pylab
-import random
+import matplotlib.pyplot as plt
import numpy as np
-fig = pylab.figure()
+fig = plt.figure()
ax = Axes3D(fig)
for c, z in zip(['r', 'g', 'b', 'y'], [30, 20, 10, 0]):
xs = np.arange(20)
- ys = [random.random() for x in xs]
+ ys = np.random.rand(20)
ax.bar(xs, ys, zs=z, zdir='y', color=c, alpha=0.8)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
-pylab.show()
+plt.show()
Modified: trunk/matplotlib/examples/mplot3d/contour3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/contour3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/contour3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,12 +1,11 @@
from mpl_toolkits.mplot3d import axes3d
-import pylab
-import random
+import matplotlib.pyplot as plt
-fig = pylab.figure()
+fig = plt.figure()
ax = axes3d.Axes3D(fig)
X, Y, Z = axes3d.get_test_data(0.05)
cset = ax.contour(X, Y, Z)
ax.clabel(cset, fontsize=9, inline=1)
-pylab.show()
+plt.show()
Property changes on: trunk/matplotlib/examples/mplot3d/contour3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/examples/mplot3d/contour.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contour.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contour3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433
Modified: trunk/matplotlib/examples/mplot3d/contour3d_demo2.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/contour3d_demo2.py 2009-08-08
18:16:01 UTC (rev 7433)
+++ trunk/matplotlib/examples/mplot3d/contour3d_demo2.py 2009-08-08
18:24:52 UTC (rev 7434)
@@ -1,12 +1,11 @@
from mpl_toolkits.mplot3d import axes3d
-import pylab
-import random
+import matplotlib.pyplot as plt
-fig = pylab.figure()
+fig = plt.figure()
ax = axes3d.Axes3D(fig)
X, Y, Z = axes3d.get_test_data(0.05)
cset = ax.contour(X, Y, Z, 16, extend3d=True)
ax.clabel(cset, fontsize=9, inline=1)
-pylab.show()
+plt.show()
Modified: trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/contourf3d_demo.py 2009-08-08
18:16:01 UTC (rev 7433)
+++ trunk/matplotlib/examples/mplot3d/contourf3d_demo.py 2009-08-08
18:24:52 UTC (rev 7434)
@@ -1,12 +1,11 @@
from mpl_toolkits.mplot3d import axes3d
-import pylab
-import random
+import matplotlib.pyplot as plt
-fig = pylab.figure()
+fig = plt.figure()
ax = axes3d.Axes3D(fig)
X, Y, Z = axes3d.get_test_data(0.05)
cset = ax.contourf(X, Y, Z)
ax.clabel(cset, fontsize=9, inline=1)
-pylab.show()
+plt.show()
Property changes on: trunk/matplotlib/examples/mplot3d/contourf3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/examples/mplot3d/contourf.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/contourf.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/contourf3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433
Modified: trunk/matplotlib/examples/mplot3d/hist3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/hist3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/hist3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,27 +1,22 @@
from mpl_toolkits.mplot3d import Axes3D
-from matplotlib.collections import PolyCollection
-from matplotlib.colors import colorConverter
-import pylab
-import random
+import matplotlib.pyplot as plt
import numpy as np
-fig = pylab.figure()
+fig = plt.figure()
ax = Axes3D(fig)
-x = np.random.rand(100) * 4
-y = np.random.rand(100) * 4
+x, y = np.random.rand(2, 100) * 4
hist, xedges, yedges = np.histogram2d(x, y, bins=4)
elements = (len(xedges) - 1) * (len(yedges) - 1)
-xpos, ypos = np.meshgrid(
- [xedges[i] + 0.25 for i in range(len(xedges) - 1)],
- [yedges[i] + 0.25 for i in range(len(yedges) - 1)])
+xpos, ypos = np.meshgrid(xedges[:-1]+0.25, yedges[:-1]+0.25)
+
xpos = xpos.flatten()
ypos = ypos.flatten()
-zpos = [0] * elements
-dx = [0.5] * elements
-dy = [0.5] * elements
+zpos = np.zeros(elements)
+dx = 0.5 * np.ones_like(zpos)
+dy = dx.copy()
dz = hist.flatten()
ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='b')
-pylab.show()
+plt.show()
Modified: trunk/matplotlib/examples/mplot3d/lines3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/lines3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/lines3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,11 +1,11 @@
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
-import pylab
+import matplotlib.pyplot as plt
mpl.rcParams['legend.fontsize'] = 10
-fig = pylab.figure()
+fig = plt.figure()
ax = Axes3D(fig)
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
@@ -15,5 +15,5 @@
ax.plot(x, y, z, label='parametric curve')
ax.legend()
-pylab.show()
+plt.show()
Modified: trunk/matplotlib/examples/mplot3d/polys3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/polys3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/polys3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,11 +1,10 @@
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection
from matplotlib.colors import colorConverter
-import pylab
-import random
+import matplotlib.pyplot as plt
import numpy as np
-fig = pylab.figure()
+fig = plt.figure()
ax = Axes3D(fig)
cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.6)
@@ -14,7 +13,7 @@
verts = []
zs = [0.0, 1.0, 2.0, 3.0]
for z in zs:
- ys = [random.random() for x in xs]
+ ys = np.random.rand(len(xs))
ys[0], ys[-1] = 0, 0
verts.append(zip(xs, ys))
@@ -27,5 +26,5 @@
ax.set_ylim3d(-1, 4)
ax.set_zlim3d(0, 1)
-pylab.show()
+plt.show()
Property changes on: trunk/matplotlib/examples/mplot3d/polys3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/examples/mplot3d/polys.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/polys.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/polys3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433
Modified: trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/scatter3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/scatter3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,21 +1,23 @@
+import numpy as np
from mpl_toolkits.mplot3d import Axes3D
-import pylab
-import random
+import matplotlib.pyplot as plt
-fig = pylab.figure()
+
+def randrange(n, vmin, vmax):
+ return (vmax-vmin)*np.random.rand(n) + vmin
+
+fig = plt.figure()
ax = Axes3D(fig)
n = 100
for c, zl, zh in [('r', -50, -25), ('b', -30, -5)]:
- xs, ys, zs = zip(*
- [(random.randrange(23, 32),
- random.randrange(100),
- random.randrange(zl, zh)
- ) for i in range(n)])
+ xs = randrange(n, 23, 32)
+ ys = randrange(n, 0, 100)
+ zs = randrange(n, zl, zh)
ax.scatter(xs, ys, zs, c=c)
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
-pylab.show()
+plt.show()
Property changes on: trunk/matplotlib/examples/mplot3d/scatter3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/examples/mplot3d/scatter.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/scatter.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/scatter3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433
Modified: trunk/matplotlib/examples/mplot3d/surface3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/surface3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/surface3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,10 +1,9 @@
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
-import pylab
-import random
+import matplotlib.pyplot as plt
import numpy as np
-fig = pylab.figure()
+fig = plt.figure()
ax = Axes3D(fig)
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
@@ -13,5 +12,5 @@
Z = np.sin(R)
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
-pylab.show()
+plt.show()
Property changes on: trunk/matplotlib/examples/mplot3d/surface3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/examples/mplot3d/surface.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/surface.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/surface3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433
Modified: trunk/matplotlib/examples/mplot3d/surface3d_demo2.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/surface3d_demo2.py 2009-08-08
18:16:01 UTC (rev 7433)
+++ trunk/matplotlib/examples/mplot3d/surface3d_demo2.py 2009-08-08
18:24:52 UTC (rev 7434)
@@ -1,9 +1,8 @@
from mpl_toolkits.mplot3d import Axes3D
-import pylab
-import random
+import matplotlib.pyplot as plt
import numpy as np
-fig = pylab.figure()
+fig = plt.figure()
ax = Axes3D(fig)
u = np.linspace(0, 2 * np.pi, 100)
@@ -14,5 +13,5 @@
z = 10 * np.outer(np.ones(np.size(u)), np.cos(v))
ax.plot_surface(x, y, z, rstride=4, cstride=4, color='b')
-pylab.show()
+plt.show()
Modified: trunk/matplotlib/examples/mplot3d/text3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/text3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/text3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,8 +1,7 @@
from mpl_toolkits.mplot3d import Axes3D
-import pylab
-import random
+import matplotlib.pyplot as plt
-fig = pylab.figure()
+fig = plt.figure()
ax = Axes3D(fig)
zdirs = (None, 'x', 'y', 'z', (1, 1, 0), (1, 1, 1))
@@ -22,5 +21,5 @@
ax.set_ylabel('Y axis')
ax.set_zlabel('Z axis')
-pylab.show()
+plt.show()
Modified: trunk/matplotlib/examples/mplot3d/wire3d_demo.py
===================================================================
--- trunk/matplotlib/examples/mplot3d/wire3d_demo.py 2009-08-08 18:16:01 UTC
(rev 7433)
+++ trunk/matplotlib/examples/mplot3d/wire3d_demo.py 2009-08-08 18:24:52 UTC
(rev 7434)
@@ -1,12 +1,11 @@
from mpl_toolkits.mplot3d import axes3d
-import pylab
-import random
+import matplotlib.pyplot as plt
import numpy as np
-fig = pylab.figure()
+fig = plt.figure()
ax = axes3d.Axes3D(fig)
X, Y, Z = axes3d.get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
-pylab.show()
+plt.show()
Property changes on: trunk/matplotlib/examples/mplot3d/wire3d_demo.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/examples/mplot3d/wire.py:5753-5771
/branches/v0_98_5_maint/examples/mplot3d/wire.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
/branches/v0_99_maint/examples/mplot3d/wire3d_demo.py:7338,7393,7395-7404,7407-7424,7428-7433
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2009-08-08 18:16:01 UTC (rev
7433)
+++ trunk/matplotlib/lib/matplotlib/path.py 2009-08-08 18:24:52 UTC (rev
7434)
@@ -129,6 +129,34 @@
self._interpolation_steps = _interpolation_steps
@classmethod
+ def make_compound_path_from_polys(cls, XY):
+ """
+ (static method) Make a compound path object to draw a number
+ of polygons with equal numbers of sides XY is a (numpolys x
+ numsides x 2) numpy array of vertices. Return object is a
+ :class:`Path`
+
+ .. plot:: mpl_examples/api/histogram_path_demo.py
+
+ """
+
+ # for each poly: 1 for the MOVETO, (numsides-1) for the LINETO, 1 for
the
+ # CLOSEPOLY; the vert for the closepoly is ignored but we still need
+ # it to keep the codes aligned with the vertices
+ numpolys, numsides, two = XY.shape
+ assert(two==2)
+ stride = numsides + 1
+ nverts = numpolys * stride
+ verts = np.zeros((nverts, 2))
+ codes = np.ones(nverts, int) * cls.LINETO
+ codes[0::stride] = cls.MOVETO
+ codes[numsides::stride] = cls.CLOSEPOLY
+ for i in range(numsides):
+ verts[i::stride] = XY[:,i]
+
+ return cls(verts, codes)
+
+ @classmethod
def make_compound_path(cls, *args):
"""
(staticmethod) Make a compound path from a list of Path
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/mathmpl.py:7338,7393,7395-7404,7407-7424,7428-7433
Property changes on:
trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/only_directives.py:7338,7393,7395-7404,7407-7424,7428-7433
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424
+ /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080,7176,7209-7211,7227,7245
/branches/v0_99_maint/lib/matplotlib/sphinxext/plot_directive.py:7338,7393,7395-7404,7407-7424,7428-7433
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins