You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(5) |
2
(4) |
3
(2) |
4
(4) |
5
(2) |
6
(32) |
7
(34) |
8
(19) |
9
(6) |
10
(7) |
11
(14) |
12
(1) |
13
(2) |
14
(8) |
15
(5) |
16
(5) |
17
(8) |
18
(8) |
19
(6) |
20
(9) |
21
(12) |
22
(1) |
23
(2) |
24
(8) |
25
(2) |
26
(1) |
27
(2) |
28
(3) |
29
|
30
(2) |
|
|
|
Revision: 7729 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7729&view=rev Author: mdboom Date: 2009年09月09日 20:01:03 +0000 (2009年9月09日) Log Message: ----------- Some more work on creating a "clean" rcParams environment for running tests. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/font_manager.py trunk/matplotlib/test/matplotlibrc Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2009年09月09日 19:55:52 UTC (rev 7728) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2009年09月09日 20:01:03 UTC (rev 7729) @@ -894,16 +894,20 @@ from testing.noseclasses import KnownFailure from nose.plugins.manager import PluginManager + # Store the current backend and all rcParams for restoration later backend = rcParams['backend'] + original_params = rcParams.copy() use('Agg') # use Agg backend for these tests - # store the old values before overriding - overrides = 'font.family', 'text.hinting' - stored = dict([(k, rcParams[k]) for k in overrides]) - + # These settings *must* be hardcoded for running the comparison + # tests and are not necessarily the default values as specified in + # rcsetup.py + rcdefaults() # Start with all defaults rcParams['font.family'] = 'Bitstream Vera Sans' rcParams['text.hinting'] = False + + # store the old values before overriding plugins = [] plugins.append( KnownFailure() ) plugins.extend( [plugin() for plugin in nose.plugins.builtin.plugins] ) @@ -914,11 +918,10 @@ success = nose.run( defaultTest=default_test_modules, config=config, ) - # restore the old rc values - rcParams.update(stored) - # restore the old backend + # restore the old backend and rcParams use(backend) + rcParams.update(original_params) return success test.__test__ = False # nose: this function is not a test Modified: trunk/matplotlib/lib/matplotlib/font_manager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/font_manager.py 2009年09月09日 19:55:52 UTC (rev 7728) +++ trunk/matplotlib/lib/matplotlib/font_manager.py 2009年09月09日 20:01:03 UTC (rev 7729) @@ -642,8 +642,7 @@ The preferred usage of font sizes is to use the relative values, e.g. 'large', instead of absolute font sizes, e.g. 12. This approach allows all text sizes to be made larger or smaller based - on the font manager's default font size, i.e. by using the - :meth:`FontManager.set_default_size` method. + on the font manager's default font size. This class will also accept a `fontconfig <http://www.fontconfig.org/>`_ pattern, if it is the only argument @@ -1022,9 +1021,7 @@ """ Return the default font size. """ - if self.default_size is None: - return rcParams['font.size'] - return self.default_size + return rcParams['font.size'] def set_default_weight(self, weight): """ @@ -1032,13 +1029,6 @@ """ self.__default_weight = weight - def set_default_size(self, size): - """ - Set the default font size in points. The initial value is set - by ``font.size`` in rc. - """ - self.default_size = size - def update_fonts(self, filenames): """ Update the font dictionary with new font files. Modified: trunk/matplotlib/test/matplotlibrc =================================================================== --- trunk/matplotlib/test/matplotlibrc 2009年09月09日 19:55:52 UTC (rev 7728) +++ trunk/matplotlib/test/matplotlibrc 2009年09月09日 20:01:03 UTC (rev 7729) @@ -1,3 +1,3 @@ backend : Agg -font.family : sans-serif -font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif +font.family : Bitstream Vera Sans +text.hinting : True \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7728 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7728&view=rev Author: mdboom Date: 2009年09月09日 19:55:52 +0000 (2009年9月09日) Log Message: ----------- Fix some documentation warnings. Modified Paths: -------------- branches/v0_99_maint/doc/api/spine_api.rst branches/v0_99_maint/doc/mpl_toolkits/mplot3d/tutorial.rst branches/v0_99_maint/doc/users/image_tutorial.rst branches/v0_99_maint/doc/users/index.rst branches/v0_99_maint/doc/users/pyplot_tutorial.rst branches/v0_99_maint/lib/matplotlib/axes.py branches/v0_99_maint/lib/matplotlib/mlab.py Modified: branches/v0_99_maint/doc/api/spine_api.rst =================================================================== --- branches/v0_99_maint/doc/api/spine_api.rst 2009年09月09日 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/api/spine_api.rst 2009年09月09日 19:55:52 UTC (rev 7728) @@ -6,7 +6,7 @@ :mod:`matplotlib.spine` ======================== -.. automodule:: matplotlib.spine +.. automodule:: matplotlib.spines :members: :undoc-members: :show-inheritance: Modified: branches/v0_99_maint/doc/mpl_toolkits/mplot3d/tutorial.rst =================================================================== --- branches/v0_99_maint/doc/mpl_toolkits/mplot3d/tutorial.rst 2009年09月09日 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/mpl_toolkits/mplot3d/tutorial.rst 2009年09月09日 19:55:52 UTC (rev 7728) @@ -55,7 +55,7 @@ Polygon plots ==================== -.. automethod:: add_collection3d +.. automethod:: Axes3D.add_collection3d .. plot:: mpl_examples/mplot3d/polys3d_demo.py Modified: branches/v0_99_maint/doc/users/image_tutorial.rst =================================================================== --- branches/v0_99_maint/doc/users/image_tutorial.rst 2009年09月09日 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/users/image_tutorial.rst 2009年09月09日 19:55:52 UTC (rev 7728) @@ -10,17 +10,20 @@ Startup commands =================== -At the very least, you'll need to have access to the :func:`~matplotlib.pyplot.imshow` function. There are a couple of ways to do it. The easy way for an interactive environment:: +At the very least, you'll need to have access to the +:func:`~matplotlib.pyplot.imshow` function. There are a couple of +ways to do it. The easy way for an interactive environment:: - $ipython -pylab - + $ipython -pylab + The imshow function is now directly accessible (it's in your `namespace <http://bytebaker.com/2008/07/30/python-namespaces/>`_). See also :ref:`pyplot-tutorial`. The more expressive, easier to understand later method (use this in your scripts to make it easier for others (including your future self) -to read) is to use the matplotlib API (see :ref:`artist-tutorial`) where you use explicit namespaces and control object creation, etc... +to read) is to use the matplotlib API (see :ref:`artist-tutorial`) +where you use explicit namespaces and control object creation, etc... .. sourcecode:: ipython @@ -28,16 +31,22 @@ In [2]: import matplotlib.image as mpimg In [3]: import numpy as np -Examples below will use the latter method, for clarity. In these examples, if you use the -pylab method, you can skip the "mpimg." and "plt." prefixes. +Examples below will use the latter method, for clarity. In these +examples, if you use the -pylab method, you can skip the "mpimg." and +"plt." prefixes. .. _importing_data: Importing image data into Numpy arrays =============================================== -Plotting image data is supported by the Python Image Library (`PIL <http://www.pythonware.com/products/pil/>`_), . Natively, matplotlib only supports PNG images. The commands shown below fall back on PIL if the native read fails. +Plotting image data is supported by the Python Image Library (`PIL +<http://www.pythonware.com/products/pil/>`_), . Natively, matplotlib +only supports PNG images. The commands shown below fall back on PIL +if the native read fails. -The image used in this example is a PNG file, but keep that PIL requirement in mind for your own data. +The image used in this example is a PNG file, but keep that PIL +requirement in mind for your own data. Here's the image we're going to play with: @@ -55,11 +64,11 @@ .. sourcecode:: ipython In [4]: img=mpimg.imread('stinkbug.png') - Out[4]: + Out[4]: array([[[ 0.40784314, 0.40784314, 0.40784314], [ 0.40784314, 0.40784314, 0.40784314], [ 0.40784314, 0.40784314, 0.40784314], - ..., + ..., [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098]], @@ -67,7 +76,7 @@ [[ 0.41176471, 0.41176471, 0.41176471], [ 0.41176471, 0.41176471, 0.41176471], [ 0.41176471, 0.41176471, 0.41176471], - ..., + ..., [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098], [ 0.42745098, 0.42745098, 0.42745098]], @@ -75,16 +84,16 @@ [[ 0.41960785, 0.41960785, 0.41960785], [ 0.41568628, 0.41568628, 0.41568628], [ 0.41568628, 0.41568628, 0.41568628], - ..., + ..., [ 0.43137255, 0.43137255, 0.43137255], [ 0.43137255, 0.43137255, 0.43137255], [ 0.43137255, 0.43137255, 0.43137255]], - ..., + ..., [[ 0.43921569, 0.43921569, 0.43921569], [ 0.43529412, 0.43529412, 0.43529412], [ 0.43137255, 0.43137255, 0.43137255], - ..., + ..., [ 0.45490196, 0.45490196, 0.45490196], [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.4509804 , 0.4509804 , 0.4509804 ]], @@ -92,7 +101,7 @@ [[ 0.44313726, 0.44313726, 0.44313726], [ 0.44313726, 0.44313726, 0.44313726], [ 0.43921569, 0.43921569, 0.43921569], - ..., + ..., [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.44705883, 0.44705883, 0.44705883], [ 0.44705883, 0.44705883, 0.44705883]], @@ -100,26 +109,46 @@ [[ 0.44313726, 0.44313726, 0.44313726], [ 0.4509804 , 0.4509804 , 0.4509804 ], [ 0.4509804 , 0.4509804 , 0.4509804 ], - ..., + ..., [ 0.44705883, 0.44705883, 0.44705883], [ 0.44705883, 0.44705883, 0.44705883], [ 0.44313726, 0.44313726, 0.44313726]]], dtype=float32) -Note the dtype there - float32. Matplotlib has rescaled the 8 bit data from each channel to floating point data between 0.0 and 1.0. As a side note, the only datatype that PIL can work with is uint8. Matplotlib plotting can handle float32 and uint8, but image reading/writing for any format other than PNG is limited to uint8 data. Why 8 bits? Most displays can only render 8 bits per channel worth of color gradation. Why can they only render 8 bits/channel? Because that's about all the human eye can see. More here (from a photography standpoint): `Luminous Landscape bit depth tutorial <http://www.luminous-landscape.com/tutorials/bit-depth.shtml>`_ +Note the dtype there - float32. Matplotlib has rescaled the 8 bit +data from each channel to floating point data between 0.0 and 1.0. As +a side note, the only datatype that PIL can work with is uint8. +Matplotlib plotting can handle float32 and uint8, but image +reading/writing for any format other than PNG is limited to uint8 +data. Why 8 bits? Most displays can only render 8 bits per channel +worth of color gradation. Why can they only render 8 bits/channel? +Because that's about all the human eye can see. More here (from a +photography standpoint): `Luminous Landscape bit depth tutorial +<http://www.luminous-landscape.com/tutorials/bit-depth.shtml>`_. -Each inner list represents a pixel. Here, with an RGB image, there are 3 values. Since it's a black and white image, R, G, and B are all similar. An RGBA (where A is alpha, or transparency), has 4 values per inner list, and a simple luminance image just has one value (and is thus only a 2-D array, not a 3-D array). For RGB and RGBA images, matplotlib supports float32 and uint8 data types. For grayscale, matplotlib supports only float32. If your array data does not meet one of these descriptions, you need to rescale it. +Each inner list represents a pixel. Here, with an RGB image, there +are 3 values. Since it's a black and white image, R, G, and B are all +similar. An RGBA (where A is alpha, or transparency), has 4 values +per inner list, and a simple luminance image just has one value (and +is thus only a 2-D array, not a 3-D array). For RGB and RGBA images, +matplotlib supports float32 and uint8 data types. For grayscale, +matplotlib supports only float32. If your array data does not meet +one of these descriptions, you need to rescale it. .. _plotting_data: Plotting numpy arrays as images =================================== -So, you have your data in a numpy array (either by importing it, or by generating it). Let's render it. In Matplotlib, this is performed using the :func:`~matplotlib.pyplot.imshow` function. Here we'll grab the plot object. This object gives you an easy way to manipulate the plot from the prompt. +So, you have your data in a numpy array (either by importing it, or by +generating it). Let's render it. In Matplotlib, this is performed +using the :func:`~matplotlib.pyplot.imshow` function. Here we'll grab +the plot object. This object gives you an easy way to manipulate the +plot from the prompt. .. sourcecode:: ipython In [5]: imgplot = plt.imshow(img) - + .. plot:: import matplotlib.pyplot as plt @@ -128,23 +157,31 @@ img = mpimg.imread('_static/stinkbug.png') imgplot = plt.imshow(img) -You can also plot any numpy array - just remember that the datatype must be float32 (and range from 0.0 to 1.0) or uint8. +You can also plot any numpy array - just remember that the datatype +must be float32 (and range from 0.0 to 1.0) or uint8. .. _Pseudocolor: - + Applying pseudocolor schemes to image plots ------------------------------------------------- -Pseudocolor can be a useful tool for enhancing contrast and visualizing your data more easily. This is especially useful when making presentations of your data using projectors - their contrast is typically quite poor. +Pseudocolor can be a useful tool for enhancing contrast and +visualizing your data more easily. This is especially useful when +making presentations of your data using projectors - their contrast is +typically quite poor. -Pseudocolor is only relevant to single-channel, grayscale, luminosity images. We currently have an RGB image. Since R, G, and B are all similar (see for yourself above or in your data), we can just pick on channel of our data: +Pseudocolor is only relevant to single-channel, grayscale, luminosity +images. We currently have an RGB image. Since R, G, and B are all +similar (see for yourself above or in your data), we can just pick on +channel of our data: .. sourcecode:: ipython In [6]: lum_img = img[:,:,0] - -This is array slicing. You can read more `here <http://www.scipy.org/Tentative_NumPy_Tutorial>`_ - + +This is array slicing. You can read more `here +<http://www.scipy.org/Tentative_NumPy_Tutorial>`_. + .. sourcecode:: ipython In [7]: imgplot = mpimg.imshow(lum_img) @@ -158,7 +195,11 @@ lum_img = img[:,:,0] plt.imshow(lum_img) -Now, with a luminosity image, the default colormap (aka lookup table, LUT), is applied. The default is called jet. There are plenty of others to choose from. Let's set some others using the :meth:`~matplotlib.image.Image.set_cmap` method on our image plot object: +Now, with a luminosity image, the default colormap (aka lookup table, +LUT), is applied. The default is called jet. There are plenty of +others to choose from. Let's set some others using the +:meth:`~matplotlib.image.Image.set_cmap` method on our image plot +object: .. sourcecode:: ipython @@ -173,11 +214,11 @@ lum_img = img[:,:,0] imgplot = plt.imshow(lum_img) imgplot.set_cmap('hot') - + .. sourcecode:: ipython In [9]: imgplot.set_cmap('spectral') - + .. plot:: import matplotlib.pyplot as plt @@ -188,18 +229,22 @@ imgplot = plt.imshow(lum_img) imgplot.set_cmap('spectral') -There are many other colormap schemes available. See a list and images of the colormaps `here <http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html>`_ - +There are many other colormap schemes available. See a list and +images of the colormaps `here +<http://matplotlib.sourceforge.net/examples/pylab_examples/show_colormaps.html>`_. + .. _Color Bars Color scale reference ------------------------ -It's helpful to have an idea of what value a color represents. We can do that by adding color bars. It's as easy as one line: +It's helpful to have an idea of what value a color represents. We can +do that by adding color bars. It's as easy as one line: .. sourcecode:: ipython + In [10]: plt.colorbar() - + .. plot:: import matplotlib.pyplot as plt @@ -210,15 +255,22 @@ imgplot = plt.imshow(lum_img) imgplot.set_cmap('spectral') plt.colorbar() - -This adds a colorbar to your existing figure. This won't automatically change if you change you switch to a different colormap - you have to re-create your plot, and add in the colorbar again. +This adds a colorbar to your existing figure. This won't +automatically change if you change you switch to a different +colormap - you have to re-create your plot, and add in the colorbar +again. + .. _Data ranges Examining a specific data range --------------------------------- -Sometimes you want to enhance the contrast in your image, or expand the contrast in a particular region while sacrificing the detail in colors that don't vary much, or don't matter. A good tool to find interesting regions is the histogram. To create a histogram of our image data, we use the :func:`~matplotlib.pyplot.hist` function. +Sometimes you want to enhance the contrast in your image, or expand +the contrast in a particular region while sacrificing the detail in +colors that don't vary much, or don't matter. A good tool to find +interesting regions is the histogram. To create a histogram of our +image data, we use the :func:`~matplotlib.pyplot.hist` function. .. sourcecode:: ipython @@ -233,7 +285,14 @@ lum_img = img[:,:,0] plt.hist(lum_img, range=(0.0,1.0)) -Most often, the "interesting" part of the image is around the peak, and you can get extra contrast by clipping the regions above and/or below the peak. In our histogram, it looks like there's not much useful information in the high end (not many white things in the image). Let's adjust the upper limit, so that we effectively "zoom in on" part of the histogram. We do this by calling the :meth:`~matplotlib.image.Image.set_clim` method of the image plot object. +Most often, the "interesting" part of the image is around the peak, +and you can get extra contrast by clipping the regions above and/or +below the peak. In our histogram, it looks like there's not much +useful information in the high end (not many white things in the +image). Let's adjust the upper limit, so that we effectively "zoom in +on" part of the histogram. We do this by calling the +:meth:`~matplotlib.image.Image.set_clim` method of the image plot +object. .. sourcecode:: ipython @@ -249,8 +308,8 @@ img = mpimg.imread('_static/stinkbug.png') lum_img = img[:,:,0] imgplot = plt.imshow(lum_img) - a.set_title('Before') - plt.colorbar(ticks=[0.1,0.3,0.5,0.7], orientation ='horizontal') + a.set_title('Before') + plt.colorbar(ticks=[0.1,0.3,0.5,0.7], orientation ='horizontal') a=fig.add_subplot(1,2,2) imgplot = plt.imshow(lum_img) imgplot.set_clim(0.0,0.7) @@ -260,9 +319,21 @@ .. _Interpolation: Array Interpolation schemes ------------------------------------ -Interpolation calculates what the color or value of a pixel "should" be, according to different mathematical schemes. One common place that this happens is when you resize an image. The number of pixels change, but you want the same information. Since pixels are discrete, there's missing space. Interpolation is how you fill that space. This is why your images sometimes come out looking pixelated when you blow them up. The effect is more pronounced when the difference between the original image and the expanded image is greater. Let's take our image and shrink it. We're effectively discarding pixels, only keeping a select few. Now when we plot it, that data gets blown up to the size on your screen. The old pixels aren't there anymore, and the computer has to draw in pixels to fill that space. +--------------------------- +Interpolation calculates what the color or value of a pixel "should" +be, according to different mathematical schemes. One common place +that this happens is when you resize an image. The number of pixels +change, but you want the same information. Since pixels are discrete, +there's missing space. Interpolation is how you fill that space. +This is why your images sometimes come out looking pixelated when you +blow them up. The effect is more pronounced when the difference +between the original image and the expanded image is greater. Let's +take our image and shrink it. We're effectively discarding pixels, +only keeping a select few. Now when we plot it, that data gets blown +up to the size on your screen. The old pixels aren't there anymore, +and the computer has to draw in pixels to fill that space. + .. sourcecode:: ipython In [8]: import Image @@ -272,7 +343,7 @@ In [12]: imgplot = mpimg.imshow(rsizeArr) .. plot:: - + import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np @@ -283,7 +354,8 @@ lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) -Here we have the default interpolation, bilinear, since we did not give :func:`~matplotlib.pyplot.imshow` any interpolation argument. +Here we have the default interpolation, bilinear, since we did not +give :func:`~matplotlib.pyplot.imshow` any interpolation argument. Let's try some others: @@ -302,10 +374,10 @@ rsizeArr = np.asarray(rsize) lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) - imgplot.set_interpolation('nearest') - + imgplot.set_interpolation('nearest') + .. sourcecode:: ipython - + In [10]: imgplot.set_interpolation('bicubic') .. plot:: @@ -320,5 +392,6 @@ lum_img = rsizeArr[:,:,0] imgplot = plt.imshow(rsizeArr) imgplot.set_interpolation('bicubic') - -Bicubic interpolation is often used when blowing up photos - people tend to prefer blurry over pixelated. \ No newline at end of file + +Bicubic interpolation is often used when blowing up photos - people +tend to prefer blurry over pixelated. Modified: branches/v0_99_maint/doc/users/index.rst =================================================================== --- branches/v0_99_maint/doc/users/index.rst 2009年09月09日 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/users/index.rst 2009年09月09日 19:55:52 UTC (rev 7728) @@ -23,7 +23,6 @@ artists.rst legend_guide.rst event_handling.rst - legend.rst transforms_tutorial.rst path_tutorial.rst annotations_guide.rst Modified: branches/v0_99_maint/doc/users/pyplot_tutorial.rst =================================================================== --- branches/v0_99_maint/doc/users/pyplot_tutorial.rst 2009年09月09日 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/doc/users/pyplot_tutorial.rst 2009年09月09日 19:55:52 UTC (rev 7728) @@ -165,17 +165,17 @@ ``figure(1)`` will be created by default, just as a ``subplot(111)`` will be created by default if you don't manually specify an axes. The :func:`~matplotlib.pyplot.subplot` command specifies ``numrows, - numcols, fignum`` where ``fignum`` ranges from 1 to -``numrows*numcols``. The commas in the ``subplot`` command are optional -if ``numrows*numcols<10``. So ``subplot(211)`` is identical to -``subplot(2,1,1)``. You can create an arbitrary number of subplots +numcols, fignum`` where ``fignum`` ranges from 1 to +``numrows*numcols``. The commas in the ``subplot`` command are +optional if ``numrows*numcols<10``. So ``subplot(211)`` is identical +to ``subplot(2,1,1)``. You can create an arbitrary number of subplots and axes. If you want to place an axes manually, ie, not on a rectangular grid, use the :func:`~matplotlib.pyplot.axes` command, which allows you to specify the location as ``axes([left, bottom, width, height])`` where all values are in fractional (0 to 1) coordinates. See :ref:`pylab_examples-axes_demo` for an example of -placing axes manually and :ref:`pylab_examples-line_styles` for an example -with lots-o-subplots. +placing axes manually and :ref:`pylab_examples-line_styles` for an +example with lots-o-subplots. You can create multiple figures by using multiple @@ -267,6 +267,6 @@ In this basic example, both the ``xy`` (arrow tip) and ``xytext`` locations (text location) are in data coordinates. There are a variety of other coordinate systems one can choose -- see -:ref:`annotations-tutorial` and :ref:`plotting-guide-annotation` -for details. More examples can be found -in :ref:`pylab_examples-annotation_demo`. +:ref:`annotations-tutorial` and :ref:`plotting-guide-annotation` for +details. More examples can be found in +:ref:`pylab_examples-annotation_demo`. Modified: branches/v0_99_maint/lib/matplotlib/axes.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/axes.py 2009年09月09日 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/lib/matplotlib/axes.py 2009年09月09日 19:55:52 UTC (rev 7728) @@ -1338,7 +1338,7 @@ def add_artist(self, a): ''' - Add any :class:`~matplotlib.artist.Artist` to the axes + Add any :class:`~matplotlib.artist.Artist` to the axes. Returns the artist. ''' @@ -1351,8 +1351,8 @@ def add_collection(self, collection, autolim=True): ''' - add a :class:`~matplotlib.collections.Collection` instance - to the axes + Add a :class:`~matplotlib.collections.Collection` instance + to the axes. Returns the collection. ''' @@ -3710,15 +3710,15 @@ *maxlags* is a positive integer detailing the number of lags to show. The default value of *None* will return all - :math:`2 \mathrm{len}(x) - 1` lags. + :math:`2 \times \mathrm{len}(x) - 1` lags. The return value is a tuple (*lags*, *c*, *linecol*, *b*) where - - *linecol* is the - :class:`~matplotlib.collections.LineCollection` + - *linecol* is the + :class:`~matplotlib.collections.LineCollection` - - *b* is the *x*-axis. + - *b* is the *x*-axis. .. seealso:: Modified: branches/v0_99_maint/lib/matplotlib/mlab.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/mlab.py 2009年09月09日 18:41:43 UTC (rev 7727) +++ branches/v0_99_maint/lib/matplotlib/mlab.py 2009年09月09日 19:55:52 UTC (rev 7728) @@ -569,7 +569,7 @@ example script that shows that this :func:`cohere_pairs` and :func:`cohere` give the same results for a given pair. - .. sealso:: + .. seealso:: :func:`psd` For information about the methods used to compute This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7727 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7727&view=rev Author: ryanmay Date: 2009年09月09日 18:41:43 +0000 (2009年9月09日) Log Message: ----------- Include 'top' keyword argument in docstring for Figure.subplots_adjust(). Modified Paths: -------------- branches/v0_99_maint/lib/matplotlib/figure.py Modified: branches/v0_99_maint/lib/matplotlib/figure.py =================================================================== --- branches/v0_99_maint/lib/matplotlib/figure.py 2009年09月09日 16:39:26 UTC (rev 7726) +++ branches/v0_99_maint/lib/matplotlib/figure.py 2009年09月09日 18:41:43 UTC (rev 7727) @@ -850,7 +850,7 @@ *fancybox*: [ None | False | True ] if True, draw a frame with a round fancybox. If None, use rc - + *shadow*: [ None | False | True ] If *True*, draw a shadow behind legend. If *None*, use rc settings. @@ -1064,7 +1064,8 @@ def subplots_adjust(self, *args, **kwargs): """ - fig.subplots_adjust(left=None, bottom=None, right=None, wspace=None, hspace=None) + fig.subplots_adjust(left=None, bottom=None, right=None, top=None, + wspace=None, hspace=None) Update the :class:`SubplotParams` with *kwargs* (defaulting to rc where None) and update the subplot locations This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7726 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7726&view=rev Author: jswhit Date: 2009年09月09日 16:39:26 +0000 (2009年9月09日) Log Message: ----------- added __len__ methods (required for date2index) Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdf.py trunk/toolkits/basemap/lib/mpl_toolkits/basemap/pupynere.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdf.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdf.py 2009年09月09日 16:28:43 UTC (rev 7725) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/netcdf.py 2009年09月09日 16:39:26 UTC (rev 7726) @@ -74,5 +74,8 @@ else: return datout + def __len__(self): + return self.shape[0] + def typecode(self): return _typecodes[self.dtype] Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/pupynere.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/pupynere.py 2009年09月09日 16:28:43 UTC (rev 7725) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/pupynere.py 2009年09月09日 16:39:26 UTC (rev 7726) @@ -580,6 +580,9 @@ def shape(self): return self.data.shape + def __len__(self): + return self.data.shape[0] + def getValue(self): return self.data.item() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7725 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7725&view=rev Author: jswhit Date: 2009年09月09日 16:28:43 +0000 (2009年9月09日) Log Message: ----------- update date2index wrapper to be consistent with date2index in netcdftime.py Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009年09月09日 14:47:09 UTC (rev 7724) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009年09月09日 16:28:43 UTC (rev 7725) @@ -3886,7 +3886,7 @@ cdftime = netcdftime.utime(units,calendar=calendar) return cdftime.date2num(dates) -def date2index(dates, nctime, calendar='proleptic_gregorian'): +def date2index(dates, nctime, calendar='proleptic_gregorian',select='exact'): """ Return indices of a netCDF time variable corresponding to the given dates. @@ -3919,18 +3919,18 @@ If ``calendar=None``, will use ``calendar`` attribute of ``nctime`` object, and if that attribute does not exist calendar is set to ``standard``. - select The index selection method. ``exact`` wil return the + select The index selection method. ``exact`` will return the indices perfectly matching the dates given. ``before`` and ``after`` will return the indices corresponding to the dates just before or after the given dates if an exact match cannot be found. ``nearest`` will return the indices that - correspond to the closest dates. + correspond to the closest dates. Default ``exact``. ============== ==================================================== Returns an index or a sequence of indices. """ - return netcdftime.date2index(dates, nctime, calendar=None) + return netcdftime.date2index(dates, nctime, calendar=calendar, select=select) def maskoceans(lonsin,latsin,datain,inlands=False): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7724 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7724&view=rev Author: mdboom Date: 2009年09月09日 14:47:09 +0000 (2009年9月09日) Log Message: ----------- Merged revisions 7483,7485,7487-7488,7491-7497,7503-7505,7507-7508,7510-7513,7515-7516,7518,7520,7524-7527,7531-7532,7534-7535,7537-7540,7542-7551,7568,7570,7578-7581,7585-7587,7590-7597,7599,7601-7606,7608-7615,7619-7625,7627-7632,7634-7637,7641-7702,7704-7706,7710-7716,7718-7723 via svnmerge from https://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib Modified Paths: -------------- branches/mathtex/CHANGELOG branches/mathtex/CXX/IndirectPythonInterface.hxx branches/mathtex/Makefile branches/mathtex/agg24/include/agg_basics.h branches/mathtex/boilerplate.py branches/mathtex/doc/_templates/indexsidebar.html branches/mathtex/doc/_templates/layout.html branches/mathtex/doc/api/index_backend_api.rst branches/mathtex/doc/devel/coding_guide.rst branches/mathtex/doc/devel/documenting_mpl.rst branches/mathtex/doc/devel/release_guide.rst branches/mathtex/doc/faq/howto_faq.rst branches/mathtex/doc/faq/installing_faq.rst branches/mathtex/doc/sphinxext/gen_gallery.py branches/mathtex/doc/sphinxext/gen_rst.py branches/mathtex/doc/users/artists.rst branches/mathtex/doc/users/event_handling.rst branches/mathtex/doc/users/index.rst branches/mathtex/doc/users/index_text.rst branches/mathtex/doc/users/installing.rst branches/mathtex/doc/users/license.rst branches/mathtex/doc/users/navigation_toolbar.rst branches/mathtex/doc/users/shell.rst branches/mathtex/doc/users/whats_new.rst branches/mathtex/examples/event_handling/pipong.py branches/mathtex/examples/event_handling/pong_gtk.py branches/mathtex/examples/event_handling/pong_qt.py branches/mathtex/examples/event_handling/viewlims.py branches/mathtex/examples/pylab_examples/barb_demo.py branches/mathtex/examples/pylab_examples/multi_image.py branches/mathtex/examples/pylab_examples/shading_example.py branches/mathtex/examples/units/annotate_with_units.py branches/mathtex/examples/units/bar_demo2.py branches/mathtex/examples/units/radian_demo.py branches/mathtex/lib/matplotlib/__init__.py branches/mathtex/lib/matplotlib/_cm.py branches/mathtex/lib/matplotlib/artist.py branches/mathtex/lib/matplotlib/axes.py branches/mathtex/lib/matplotlib/axis.py branches/mathtex/lib/matplotlib/backend_bases.py branches/mathtex/lib/matplotlib/backends/backend_agg.py branches/mathtex/lib/matplotlib/backends/backend_emf.py branches/mathtex/lib/matplotlib/backends/backend_macosx.py branches/mathtex/lib/matplotlib/backends/backend_mixed.py branches/mathtex/lib/matplotlib/backends/backend_pdf.py branches/mathtex/lib/matplotlib/backends/backend_ps.py branches/mathtex/lib/matplotlib/backends/backend_svg.py branches/mathtex/lib/matplotlib/bezier.py branches/mathtex/lib/matplotlib/blocking_input.py branches/mathtex/lib/matplotlib/cbook.py branches/mathtex/lib/matplotlib/cm.py branches/mathtex/lib/matplotlib/collections.py branches/mathtex/lib/matplotlib/colorbar.py branches/mathtex/lib/matplotlib/colors.py branches/mathtex/lib/matplotlib/config/mplconfig.py branches/mathtex/lib/matplotlib/config/rcsetup.py branches/mathtex/lib/matplotlib/dates.py branches/mathtex/lib/matplotlib/figure.py branches/mathtex/lib/matplotlib/image.py branches/mathtex/lib/matplotlib/legend.py branches/mathtex/lib/matplotlib/lines.py branches/mathtex/lib/matplotlib/mlab.py branches/mathtex/lib/matplotlib/offsetbox.py branches/mathtex/lib/matplotlib/patches.py branches/mathtex/lib/matplotlib/projections/geo.py branches/mathtex/lib/matplotlib/projections/polar.py branches/mathtex/lib/matplotlib/pyplot.py branches/mathtex/lib/matplotlib/quiver.py branches/mathtex/lib/matplotlib/rcsetup.py branches/mathtex/lib/matplotlib/scale.py branches/mathtex/lib/matplotlib/spines.py branches/mathtex/lib/matplotlib/table.py branches/mathtex/lib/matplotlib/text.py branches/mathtex/lib/matplotlib/ticker.py branches/mathtex/lib/matplotlib/transforms.py branches/mathtex/lib/matplotlib/units.py branches/mathtex/lib/mpl_toolkits/axes_grid/axislines.py branches/mathtex/lib/mpl_toolkits/axes_grid/inset_locator.py branches/mathtex/matplotlibrc.template branches/mathtex/release/osx/Makefile branches/mathtex/setup.py branches/mathtex/setupegg.py branches/mathtex/setupext.py branches/mathtex/src/_backend_agg.cpp branches/mathtex/src/_backend_agg.h branches/mathtex/src/_macosx.m branches/mathtex/src/ft2font.cpp branches/mathtex/src/ft2font.h branches/mathtex/test/README.txt branches/mathtex/test/matplotlibrc Added Paths: ----------- branches/mathtex/examples/axes_grid/demo_axisline_style.py branches/mathtex/examples/event_handling/looking_glass.py branches/mathtex/examples/event_handling/resample.py branches/mathtex/examples/pylab_examples/demo_agg_filter.py branches/mathtex/lib/matplotlib/testing/ branches/mathtex/lib/matplotlib/testing/jpl_units/ branches/mathtex/lib/matplotlib/tests/ branches/mathtex/lib/matplotlib/tests/baseline_images/ branches/mathtex/lib/matplotlib/tests/baseline_images/test_axes/ branches/mathtex/lib/matplotlib/tests/baseline_images/test_dates/ branches/mathtex/lib/matplotlib/tests/baseline_images/test_image/ branches/mathtex/lib/matplotlib/tests/baseline_images/test_spines/ Removed Paths: ------------- branches/mathtex/bootstrap.py branches/mathtex/buildout.cfg branches/mathtex/doc/users/annotations.rst branches/mathtex/doc/users/plotting/annotation.rst branches/mathtex/doc/users/plotting/legend.rst branches/mathtex/lib/matplotlib/testing/jpl_units/ branches/mathtex/lib/matplotlib/tests/baseline_images/ branches/mathtex/lib/matplotlib/tests/baseline_images/test_axes/ branches/mathtex/lib/matplotlib/tests/baseline_images/test_dates/ branches/mathtex/lib/matplotlib/tests/baseline_images/test_image/ branches/mathtex/lib/matplotlib/tests/baseline_images/test_spines/ branches/mathtex/test/consolidate_diff_images.sh branches/mathtex/test/mplTest/ branches/mathtex/test/run-mpl-test.py branches/mathtex/test/test_artists/ branches/mathtex/test/test_backends/ branches/mathtex/test/test_basemap/ branches/mathtex/test/test_cxx/ branches/mathtex/test/test_mathtext/ branches/mathtex/test/test_matplotlib/ branches/mathtex/test/test_numerix/ branches/mathtex/test/test_plots/ branches/mathtex/test/test_pylab/ branches/mathtex/test/test_transforms/ Property Changed: ---------------- branches/mathtex/ branches/mathtex/doc/pyplots/README branches/mathtex/doc/sphinxext/gen_gallery.py branches/mathtex/doc/sphinxext/gen_rst.py branches/mathtex/examples/misc/multiprocess.py branches/mathtex/examples/mplot3d/contour3d_demo.py branches/mathtex/examples/mplot3d/contourf3d_demo.py branches/mathtex/examples/mplot3d/polys3d_demo.py branches/mathtex/examples/mplot3d/scatter3d_demo.py branches/mathtex/examples/mplot3d/surface3d_demo.py branches/mathtex/examples/mplot3d/wire3d_demo.py branches/mathtex/lib/matplotlib/sphinxext/mathmpl.py branches/mathtex/lib/matplotlib/sphinxext/only_directives.py branches/mathtex/lib/matplotlib/sphinxext/plot_directive.py Property changes on: branches/mathtex ___________________________________________________________________ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /trunk/matplotlib:1-7478 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7253 /trunk/matplotlib:1-7723 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,7428-7433,7442-7444,7446 /trunk/matplotlib:7265-7303,7308-7317,7321,7339-7478 + /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,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 /trunk/matplotlib:7265-7303,7308-7317,7321,7339-7478,7483-7723 Modified: branches/mathtex/CHANGELOG =================================================================== --- branches/mathtex/CHANGELOG 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/CHANGELOG 2009年09月09日 14:47:09 UTC (rev 7724) @@ -1,3 +1,28 @@ +2009年09月07日 AxesGrid : implemented axisline style. + Added a demo examples/axes_grid/demo_axisline_style.py- JJL + +2009年09月04日 Make the textpath class as a separate moduel + (textpath.py). Add support for mathtext and tex.- JJL + +2009年09月01日 Added support for Gouraud interpolated triangles. + pcolormesh now accepts shading='gouraud' as an option. - MGD + +2009年08月29日 Added matplotlib.testing package, which contains a Nose + plugin and a decorator that lets tests be marked as + KnownFailures - ADS + +2009年08月20日 Added scaled dict to AutoDateFormatter for customized + scales - JDH + +2009年08月15日 Pyplot interface: the current image is now tracked at the + figure and axes level, addressing tracker item 1656374. - EF + +2009年08月15日 Docstrings are now manipulated with decorators defined + in a new module, docstring.py, thanks to Jason Coombs. - EF + +2009年08月14日 Add support for image filtering for agg back end. See the example + demo_agg_filter.py. -JJL + 2009年08月09日 AnnotationBbox added. Similar to Annotation, but works with OffsetBox instead of Text. See the example demo_annotation_box.py. -JJL Modified: branches/mathtex/CXX/IndirectPythonInterface.hxx =================================================================== --- branches/mathtex/CXX/IndirectPythonInterface.hxx 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/CXX/IndirectPythonInterface.hxx 2009年09月09日 14:47:09 UTC (rev 7724) @@ -193,6 +193,6 @@ void _XDECREF( PyObject *op ); char *__Py_PackageContext(); -}; +} #endif // __CXX_INDIRECT_PYTHON_INTERFACE__HXX__ Modified: branches/mathtex/Makefile =================================================================== --- branches/mathtex/Makefile 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/Makefile 2009年09月09日 14:47:09 UTC (rev 7724) @@ -28,10 +28,13 @@ tar cvfz pyback.tar.gz *.py lib src examples/*.py unit/*.py -build_osx105: +_build_osx105: CFLAGS="-Os -arch i386 -arch ppc" LDFLAGS="-Os -arch i386 -arch ppc" python setup.py build +build_osx105: + echo "Use 'make -f fetch deps mpl_install instead'" + jdh_doc_snapshot: svn up;\ python setup.py install --prefix=~/dev;\ Modified: branches/mathtex/agg24/include/agg_basics.h =================================================================== --- branches/mathtex/agg24/include/agg_basics.h 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/agg24/include/agg_basics.h 2009年09月09日 14:47:09 UTC (rev 7724) @@ -2,8 +2,8 @@ // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // @@ -25,12 +25,12 @@ #else namespace agg { - // The policy of all AGG containers and memory allocation strategy + // The policy of all AGG containers and memory allocation strategy // in general is that no allocated data requires explicit construction. // It means that the allocator can be really simple; you can even - // replace new/delete to malloc/free. The constructors and destructors - // won't be called in this case, however everything will remain working. - // The second argument of deallocate() is the size of the allocated + // replace new/delete to malloc/free. The constructors and destructors + // won't be called in this case, however everything will remain working. + // The second argument of deallocate() is the size of the allocated // block. You can use this information if you wish. //------------------------------------------------------------pod_allocator template<class T> struct pod_allocator @@ -40,8 +40,8 @@ }; // Single object allocator. It's also can be replaced with your custom - // allocator. The difference is that it can only allocate a single - // object and the constructor and destructor must be called. + // allocator. The difference is that it can only allocate a single + // object and the constructor and destructor must be called. // In AGG there is no need to allocate an array of objects with // calling their constructors (only single ones). So that, if you // replace these new/delete to malloc/free make sure that the in-place @@ -213,23 +213,23 @@ enum cover_scale_e { cover_shift = 8, //----cover_shift - cover_size = 1 << cover_shift, //----cover_size - cover_mask = cover_size - 1, //----cover_mask - cover_none = 0, //----cover_none - cover_full = cover_mask //----cover_full + cover_size = 1 << cover_shift, //----cover_size + cover_mask = cover_size - 1, //----cover_mask + cover_none = 0, //----cover_none + cover_full = cover_mask //----cover_full }; //----------------------------------------------------poly_subpixel_scale_e - // These constants determine the subpixel accuracy, to be more precise, - // the number of bits of the fractional part of the coordinates. + // These constants determine the subpixel accuracy, to be more precise, + // the number of bits of the fractional part of the coordinates. // The possible coordinate capacity in bits can be calculated by formula: // sizeof(int) * 8 - poly_subpixel_shift, i.e, for 32-bit integers and // 8-bits fractional part the capacity is 24 bits. enum poly_subpixel_scale_e { poly_subpixel_shift = 8, //----poly_subpixel_shift - poly_subpixel_scale = 1<<poly_subpixel_shift, //----poly_subpixel_scale - poly_subpixel_mask = poly_subpixel_scale-1, //----poly_subpixel_mask + poly_subpixel_scale = 1<<poly_subpixel_shift, //----poly_subpixel_scale + poly_subpixel_mask = poly_subpixel_scale-1 //----poly_subpixel_mask }; //----------------------------------------------------------filling_rule_e @@ -253,7 +253,7 @@ { return rad * 180.0 / pi; } - + //----------------------------------------------------------------rect_base template<class T> struct rect_base { @@ -265,9 +265,9 @@ rect_base(T x1_, T y1_, T x2_, T y2_) : x1(x1_), y1(y1_), x2(x2_), y2(y2_) {} - void init(T x1_, T y1_, T x2_, T y2_) + void init(T x1_, T y1_, T x2_, T y2_) { - x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_; + x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_; } const self_type& normalize() @@ -299,17 +299,17 @@ }; //-----------------------------------------------------intersect_rectangles - template<class Rect> + template<class Rect> inline Rect intersect_rectangles(const Rect& r1, const Rect& r2) { Rect r = r1; - // First process x2,y2 because the other order - // results in Internal Compiler Error under - // Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in + // First process x2,y2 because the other order + // results in Internal Compiler Error under + // Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in // case of "Maximize Speed" optimization option. //----------------- - if(r.x2 > r2.x2) r.x2 = r2.x2; + if(r.x2 > r2.x2) r.x2 = r2.x2; if(r.y2 > r2.y2) r.y2 = r2.y2; if(r.x1 < r2.x1) r.x1 = r2.x1; if(r.y1 < r2.y1) r.y1 = r2.y1; @@ -318,7 +318,7 @@ //---------------------------------------------------------unite_rectangles - template<class Rect> + template<class Rect> inline Rect unite_rectangles(const Rect& r1, const Rect& r2) { Rect r = r1; @@ -336,26 +336,26 @@ //---------------------------------------------------------path_commands_e enum path_commands_e { - path_cmd_stop = 0, //----path_cmd_stop - path_cmd_move_to = 1, //----path_cmd_move_to - path_cmd_line_to = 2, //----path_cmd_line_to - path_cmd_curve3 = 3, //----path_cmd_curve3 - path_cmd_curve4 = 4, //----path_cmd_curve4 + path_cmd_stop = 0, //----path_cmd_stop + path_cmd_move_to = 1, //----path_cmd_move_to + path_cmd_line_to = 2, //----path_cmd_line_to + path_cmd_curve3 = 3, //----path_cmd_curve3 + path_cmd_curve4 = 4, //----path_cmd_curve4 path_cmd_curveN = 5, //----path_cmd_curveN path_cmd_catrom = 6, //----path_cmd_catrom path_cmd_ubspline = 7, //----path_cmd_ubspline path_cmd_end_poly = 0x0F, //----path_cmd_end_poly - path_cmd_mask = 0x0F //----path_cmd_mask + path_cmd_mask = 0x0F //----path_cmd_mask }; //------------------------------------------------------------path_flags_e enum path_flags_e { - path_flags_none = 0, //----path_flags_none - path_flags_ccw = 0x10, //----path_flags_ccw - path_flags_cw = 0x20, //----path_flags_cw + path_flags_none = 0, //----path_flags_none + path_flags_ccw = 0x10, //----path_flags_ccw + path_flags_cw = 0x20, //----path_flags_cw path_flags_close = 0x40, //----path_flags_close - path_flags_mask = 0xF0 //----path_flags_mask + path_flags_mask = 0xF0 //----path_flags_mask }; //---------------------------------------------------------------is_vertex @@ -372,7 +372,7 @@ //-----------------------------------------------------------------is_stop inline bool is_stop(unsigned c) - { + { return c == path_cmd_stop; } @@ -416,7 +416,7 @@ inline bool is_close(unsigned c) { return (c & ~(path_flags_cw | path_flags_ccw)) == - (path_cmd_end_poly | path_flags_close); + (path_cmd_end_poly | path_flags_close); } //------------------------------------------------------------is_next_poly @@ -440,19 +440,19 @@ //-------------------------------------------------------------is_oriented inline bool is_oriented(unsigned c) { - return (c & (path_flags_cw | path_flags_ccw)) != 0; + return (c & (path_flags_cw | path_flags_ccw)) != 0; } //---------------------------------------------------------------is_closed inline bool is_closed(unsigned c) { - return (c & path_flags_close) != 0; + return (c & path_flags_close) != 0; } //----------------------------------------------------------get_close_flag inline unsigned get_close_flag(unsigned c) { - return c & path_flags_close; + return c & path_flags_close; } //-------------------------------------------------------clear_orientation @@ -513,7 +513,7 @@ int x1, x2; const T* ptr; const_row_info() {} - const_row_info(int x1_, int x2_, const T* ptr_) : + const_row_info(int x1_, int x2_, const T* ptr_) : x1(x1_), x2(x2_), ptr(ptr_) {} }; Modified: branches/mathtex/boilerplate.py =================================================================== --- branches/mathtex/boilerplate.py 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/boilerplate.py 2009年09月09日 14:47:09 UTC (rev 7724) @@ -1,5 +1,5 @@ # Wrap the plot commands defined in axes. The code generated by this -# file is pasted into pylab.py. We did try to do this the smart way, +# file is pasted into pyplot.py. We did try to do this the smart way, # with callable functions and new.function, but could never get the # docstrings right for python2.2. See # http://groups.google.com/group/comp.lang.python/browse_frm/thread/dcd63ec13096a0f6/1b14640f3a4ad3dc?#1b14640f3a4ad3dc @@ -13,13 +13,14 @@ import types # import the local copy of matplotlib, not the installed one -sys.path.insert(0, './lib') +#sys.path.insert(0, './lib') from matplotlib.axes import Axes from matplotlib.cbook import dedent _fmtplot = """\ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost +@autogen_docstring(Axes.%(func)s) def %(func)s(%(argspec)s): %(ax)s = gca() # allow callers to override the hold state by passing hold=True|False @@ -34,19 +35,16 @@ %(ax)s.hold(%(washold)s) %(mappable)s return %(ret)s -if Axes.%(func)s.__doc__ is not None: - %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + __docstring_addendum """ _fmtmisc = """\ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost +...@do...py_dedent(Axes.%(func)s) def %(func)s(%(argspec)s): %(ret)s = gca().%(func)s(%(call)s) draw_if_interactive() return %(ret)s -if Axes.%(func)s.__doc__ is not None: - %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) """ # these methods are all simple wrappers of Axes methods by the same @@ -106,16 +104,16 @@ ) cmappable = { - 'contour' : 'if %(ret)s._A is not None: gci._current = %(ret)s', - 'contourf': 'if %(ret)s._A is not None: gci._current = %(ret)s', - 'hexbin' : 'gci._current = %(ret)s', - 'scatter' : 'gci._current = %(ret)s', - 'pcolor' : 'gci._current = %(ret)s', - 'pcolormesh' : 'gci._current = %(ret)s', - 'imshow' : 'gci._current = %(ret)s', - 'spy' : 'gci._current = %(ret)s', - 'quiver' : 'gci._current = %(ret)s', - 'specgram' : 'gci._current = %(ret)s[-1]', + 'contour' : 'if %(ret)s._A is not None: sci(%(ret)s)', + 'contourf': 'if %(ret)s._A is not None: sci(%(ret)s)', + 'hexbin' : 'sci(%(ret)s)', + 'scatter' : 'sci(%(ret)s)', + 'pcolor' : 'sci(%(ret)s)', + 'pcolormesh': 'sci(%(ret)s)', + 'imshow' : 'sci(%(ret)s)', + 'spy' : 'sci(%(ret)s)', + 'quiver' : 'sci(%(ret)s)', + 'specgram' : 'sci(%(ret)s[-1])', } @@ -235,3 +233,4 @@ # add all the colormaps (autumn, hsv, ....) for name in cmaps: print _fmtcmap%locals() + Deleted: branches/mathtex/bootstrap.py =================================================================== --- branches/mathtex/bootstrap.py 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/bootstrap.py 2009年09月09日 14:47:09 UTC (rev 7724) @@ -1,52 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Zope Corporation and Contributors. -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# -############################################################################## -"""Bootstrap a buildout-based project - -Simply run this script in a directory containing a buildout.cfg. -The script accepts buildout command-line options, so you can -use the -c option to specify an alternate configuration file. - -$Id$ -""" - -import os, shutil, sys, tempfile, urllib2 - -tmpeggs = tempfile.mkdtemp() - -ez = {} -exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' - ).read() in ez -ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) - -import pkg_resources - -cmd = 'from setuptools.command.easy_install import main; main()' -if sys.platform == 'win32': - cmd = '"%s"' % cmd # work around spawn lamosity on windows - -ws = pkg_resources.working_set -assert os.spawnle( - os.P_WAIT, sys.executable, sys.executable, - '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout', - dict(os.environ, - PYTHONPATH= - ws.find(pkg_resources.Requirement.parse('setuptools')).location - ), - ) == 0 - -ws.add_entry(tmpeggs) -ws.require('zc.buildout') -import zc.buildout.buildout -zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) -shutil.rmtree(tmpeggs) Deleted: branches/mathtex/buildout.cfg =================================================================== --- branches/mathtex/buildout.cfg 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/buildout.cfg 2009年09月09日 14:47:09 UTC (rev 7724) @@ -1,31 +0,0 @@ -[buildout] -parts = PIL test python -develop = . -eggs = matplotlib -find-links = http://astraw.com/mpl/ - -[test] -recipe = pbp.recipe.noserunner -# Use Andrew Straw's custom packaging of noserunner with plugin support. -eggs = - pbp.recipe.noserunner==0.2.6.2 - PIL - ${buildout:eggs} -working-directory = ${buildout:directory}/test -initialization = - sys.path.insert(0,'.') - from mplTest import MplNosePlugin -plugins = - MplNosePlugin() - -[python] -recipe = zc.recipe.egg -interpreter = python -eggs = - ${buildout:eggs} - -[PIL] -# This recipe based on http://www.koansys.com/tech/install-plone-with-zopeskel-buildout-needs-pil -# Build egg with Andrew Straw's custom packaging of setuptools-compatibile PIL without Tkinter. -recipe = zc.recipe.egg -egg = PIL==1.1.6 Modified: branches/mathtex/doc/_templates/indexsidebar.html =================================================================== --- branches/mathtex/doc/_templates/indexsidebar.html 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/_templates/indexsidebar.html 2009年09月09日 14:47:09 UTC (rev 7724) @@ -8,18 +8,33 @@ pathto('users/installing') }}">installing</a> </p> -<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>. +<p>Build websites like matplotlib's, +with <a href="http://sphinx.pocoo.org/">sphinx</a> and extensions for +mpl plots, math, inheritance diagrams -- try +the <a href="http://matplotlib.sf.net/sampledoc">sampledoc</a> +tutorial. </p> + +<h3>Videos</h3> + +<p>Watch the <a href="http://conference.scipy.org/">SciPy</a> 2009 <a href="http://www.archive.org/details/scipy09_introTutorialDay2_1">intro</a> and <a href="http://www.archive.org/details/scipy09_advancedTutorialDay1_3">advanced</a> matplotlib tutorials +</p> + +<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">talk</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>MLOSS</i></a>. +</p> + + +<h3>Toolkits</h3> + <p>There are several matplotlib addon <a href="{{ pathto('users/toolkits') }}">toolkits</a>, including the projection and mapping toolkit <a href="http://matplotlib.sf.net/basemap/doc/html">basemap</a>, 3d plotting with <a href="{{ -pathto('mpl_toolkits/mplot3d/index') }}">mplot3d</a>, wild and wonderful axes and axis helpers in <a href="{{ +pathto('mpl_toolkits/mplot3d/index') }}">mplot3d</a>, axes and axis helpers in <a href="{{ pathto('mpl_toolkits/axes_grid/index') }}">axes_grid</a> and more. </p> - <h3>Need help?</h3> <p>Check the <a href="{{ pathto('users/index') }}">user guide</a>, @@ -38,7 +53,7 @@ but it is a good idea to ping us on the mailing list too.</p> <p>For details on what's new, see the detailed <a href="{{ -pathto('_static/CHANGELOG', 1) }}">changelog</a>. Anything that could +pathto('_static/CHANGELOG', 1) }}">changelog</a> or browse the <a href="http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/">source code</a>. Anything that could require changes to your existing codes is logged in the <a href="{{ pathto('api/api_changes.html', 1) }}">api changes</a> file.</p> Modified: branches/mathtex/doc/_templates/layout.html =================================================================== --- branches/mathtex/doc/_templates/layout.html 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/_templates/layout.html 2009年09月09日 14:47:09 UTC (rev 7724) @@ -2,10 +2,11 @@ {% block rootrellink %} - <li><a href="{{ pathto('index') }}">matplotlib home</a>| </li> + <li><a href="{{ pathto('index') }}">home</a>| </li> <li><a href="{{ pathto('search') }}">search</a>| </li> + <li><a href="http://matplotlib.sf.net/examples/index.html">examples</a>| </li> <li><a href="{{ pathto('gallery') }}">gallery</a>| </li> - <li><a href="{{ pathto('contents') }}">documentation </a> »</li> + <li><a href="{{ pathto('contents') }}">docs</a> »</li> {% endblock %} Modified: branches/mathtex/doc/api/index_backend_api.rst =================================================================== --- branches/mathtex/doc/api/index_backend_api.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/api/index_backend_api.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -8,5 +8,6 @@ backend_gtkagg_api.rst backend_qt4agg_api.rst backend_wxagg_api.rst + backend_pdf_api.rst dviread.rst type1font.rst Modified: branches/mathtex/doc/devel/coding_guide.rst =================================================================== --- branches/mathtex/doc/devel/coding_guide.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/devel/coding_guide.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -1,4 +1,4 @@ -M.. _coding-guide: +.. _coding-guide: ************ Coding guide @@ -561,9 +561,8 @@ -.. _license-discussion: +.. _sample-data: - Writing examples ================ @@ -602,6 +601,9 @@ print 'datafile', datafile +.. _license-discussion: + + Licenses ======== @@ -669,4 +671,116 @@ extensions for scientific computing: ipython, numpy, scipy, the enthought tool suite and python itself are all distributed under BSD compatible licenses. -> \ No newline at end of file + +Testing +======= + +Matplotlib has a testing infrastructure based on nose_, making it easy +to write new tests. The tests are in :mod:`matplotlib.tests`, and +customizations to the nose testing infrastructure are in +:mod:`matplotlib.testing`. (There is other old testing cruft around, +please ignore it while we consolidate our testing to these locations.) + +.. _nose: http://somethingaboutorange.com/mrl/projects/nose/ + +Running the tests +----------------- + +Running the tests is simple. Make sure you have nose installed and +type from within Python:: + + import matplotlib + matplotlib.test() + +Writing a simple test +--------------------- + +Many elements of Matplotlib can be tested using standard tests. For +example, here is a test from :mod:`matplotlib.tests.test_basic`:: + + from nose.tools import assert_equal + + def test_simple(): + '''very simple example test''' + assert_equal(1+1,2) + +Nose determines which functions are tests by searching for functions +beginning with "test" in their name. + +Writing an image comparison test +-------------------------------- + +Writing an image based test is only slightly more difficult than a +simple test. The main consideration is that you must specify the +"baseline", or expected, images in the +:func:`~matplotlib.testing.decorators.image_comparison` decorator. For +example, this test generates a single image and automatically tests +it:: + + import numpy as np + import matplotlib + from matplotlib.testing.decorators import image_comparison + import matplotlib.pyplot as plt + + @image_comparison(baseline_images=['spines_axes_positions.png']) + def test_spines_axes_positions(): + # SF bug 2852168 + fig = plt.figure() + x = np.linspace(0,2*np.pi,100) + y = 2*np.sin(x) + ax = fig.add_subplot(1,1,1) + ax.set_title('centered spines') + ax.plot(x,y) + ax.spines['right'].set_position(('axes',0.1)) + ax.yaxis.set_ticks_position('right') + ax.spines['top'].set_position(('axes',0.25)) + ax.xaxis.set_ticks_position('top') + ax.spines['left'].set_color('none') + ax.spines['bottom'].set_color('none') + fig.savefig('spines_axes_positions.png') + +The mechanism for comparing images is extremely simple -- it compares +an image saved in the current directory with one from the Matplotlib +sample_data repository. The correspondence is done by matching +filenames, so ensure that: + + * The filename given to :meth:`~matplotlib.figure.Figure.savefig` is + exactly the same as the filename given to + :func:`~matplotlib.testing.decorators.image_comparison` in the + ``baseline_images`` argument. + + * The correct image gets added to the sample_data respository with + the name ``test_baseline_<IMAGE_FILENAME.png>``. (See + :ref:`sample-data` above for a description of how to add files to + the sample_data repository.) + + +Known failing tests +------------------- + +If you're writing a test, you may mark it as a known failing test with +the :func:`~matplotlib.testing.decorators.knownfailureif` +decorator. This allows the test to be added to the test suite and run +on the buildbots without causing undue alarm. For example, although +the following test will fail, it is an expected failure:: + + from nose.tools import assert_equal + from matplotlib.testing.decorators import knownfailureif + + @knownfailureif(True) + def test_simple_fail(): + '''very simple example test that should fail''' + assert_equal(1+1,3) + +Note that the first argument to the +:func:`~matplotlib.testing.decorators.knownfailureif` decorator is a +fail condition, which can be a value such as True, False, or +'indeterminate', or may be a dynamically evaluated expression. + +Creating a new module in matplotlib.tests +----------------------------------------- + +Let's say you've added a new module named +``matplotlib.tests.test_whizbang_features``. To add this module to +the list of default tests, append its name to ``default_test_modules`` +in :file:`lib/matplotlib/__init__.py`. Modified: branches/mathtex/doc/devel/documenting_mpl.rst =================================================================== --- branches/mathtex/doc/devel/documenting_mpl.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/devel/documenting_mpl.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -286,7 +286,7 @@ .. literalinclude:: ../../lib/matplotlib/mpl-data/matplotlibrc -On exception to this is when referring to the examples dir. Relative +One exception to this is when referring to the examples dir. Relative paths are extremely confusing in the sphinx plot extensions, so without getting into the dirty details, it is easier to simply include a symlink to the files at the top doc level directory. This way, API Modified: branches/mathtex/doc/devel/release_guide.rst =================================================================== --- branches/mathtex/doc/devel/release_guide.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/devel/release_guide.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -122,7 +122,7 @@ sftp> put matplotlib-0.98.2.tar.gz Uploading matplotlib-0.98.2.tar.gz to /incoming/j/jd/jdh2358/uploads/matplotlib-0.98.2.tar.gz -* go https://sourceforge.net/project/admin/editpackages.php?group_id=80706 and do a +* go https://sourceforge.net/project/admin/explorer.php?group_id=80706 and do a file release. Click on the "Admin" tab to log in as an admin, and then the "File Releases" tab. Go to the bottom and click "add release" and enter the package name but not the version number in Modified: branches/mathtex/doc/faq/howto_faq.rst =================================================================== --- branches/mathtex/doc/faq/howto_faq.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/faq/howto_faq.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -68,6 +68,35 @@ ax.set_xlabel('volts', alpha=0.5) +.. _howto-multipage: + +Save multiple plots in one pdf file +----------------------------------- + +Many image file formats can only have one image per file, but some +formats support multi-page files. Currently only the pdf backend has +support for this. To make a multi-page pdf file, first initialize the +file:: + + from matplotlib.backends.backend_pdf import PdfPages + pp = PdfPages('multipage.pdf') + +You can give the :class:`~matplotlib.backends.backend_pdf.PdfPages` +object to :func:`~matplotlib.pyplot.savefig`, but you have to specify +the format:: + + savefig(pp, format='pdf') + +A simpler way is to call +:meth:`PdfPages.savefig <matplotlib.backends.backend_pdf.PdfPages.savefig>`:: + + pp.savefig() + +Finally, the multipage pdf object has to be closed:: + + pp.close() + + .. _howto-subplots-adjust: Move the edge of an axes to make room for tick labels @@ -516,8 +545,32 @@ If you have made lots of local changes and do not want to a diff against the entire tree, but rather against a single directory or -file, that is fine, but we do prefer svn diffs against HEAD. +file, that is fine, but we do prefer svn diffs against the top level +(where setup.py lives) since it is nice to have a consistent way to +apply them. +If you are posting a patch to fix a code bug, please explain your +patch in words -- what was broken before and how you fixed it. Also, +even if your patch is particularly simple, just a few lines or a +single function replacement, we encourage people to submit svn diffs +against HEAD or the branch they are patching. It just makes life +simpler for us, since we (fortunately) get a lot of contributions, and +want to receive them in a standard format. If possible, for any +non-trivial change, please include a complete, free-standing example +that the developers can run unmodified which shows the undesired +behavior pre-patch and the desired behavior post-patch, with a clear +verbal description of what to look for. The original developer may +have written the function you are working on years ago, and may no +longer be with the project, so it is quite possible you are the world +expert on the code you are patching and we want to hear as much detail +as you can offer. + +When emailing your patch and examples, feel free to paste any code +into the text of the message, indeed we encourage it, but also attach +the patches and examples since many email clients screw up the +formatting of plain text, and we spend lots of needless time trying to +reformat the code to make it usable. + You should check out the guide to developing matplotlib to make sure your patch abides by our coding conventions :ref:`developers-guide-index`. Modified: branches/mathtex/doc/faq/installing_faq.rst =================================================================== --- branches/mathtex/doc/faq/installing_faq.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/faq/installing_faq.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -295,8 +295,8 @@ If you want to install matplotlib from one of the binary installers we build, you have two choices: a dmg installer, which is a typical Installer.app, or an binary OSX egg, which you can install via -setuptools easy_install. - +setuptools easy_install. + The mkpg installer will have a "dmg" extension, and will have a name like :file:`matplotlib-0.99.0-py2.5-macosx10.5.dmg` depending on the python, matplotlib, and OSX versions. Save this file and double @@ -318,10 +318,24 @@ then you will need to set your PYTHONPATH, eg:: - export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages:$PYTHONPATH + export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages:$PYTHONPATH See also :ref:`environment-variables`. + +If you are upgrading your matplotlib using the dmg installer over an +Enthought Python Distribution, you may get an error like "You must use +a framework install of python". EPD puts their python in a directory +like :file:``//Library/Frameworks/Python.framework/Versions/4.3.0`` +where 4.3.0 is an EPD version number. The mpl installer needs the +`python` version number, so you need to create a symlink pointing your +python version to the EPS version before installing matplotlib. For +example, for python veersion 2.5 and EPD version 4.3.0:: + + > cd /Library/Frameworks/Python.framework/Versions + > ln -s 4.3.0 2.5 + + .. _easy-install-osx-egg: easy_install from egg @@ -342,7 +356,7 @@ <http://sourceforge.net/projects/matplotlib/files/>`_ directly to your harddrive, and manually install it with - > easy_install --install-dir=~/dev/lib/python2.5/site-packages/ matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg + > easy_install --install-dir=~/dev/lib/python2.5/site-packages/ matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg Some users have reported problems with the egg for 0.98 from the @@ -364,6 +378,66 @@ which prevents their installation through easy_install. Renaming is all it takes to install them; still, it's annoying. + +.. _install_from_source_on_osx_epd: + +Building and installing from source on OSX with EPD +--------------------------------------------------- + +If you have the EPD installed (:ref:`which-python-for-osx`), it might turn out +to be rather tricky to install a new version of matplotlib from source on the +Mac OS 10.5 . Here's a procedure that seems to work, at least sometimes: + +0. Remove the ~/.matplotlib folder ("rm -rf ~/.matplotlib"). + +1. Edit the file (make a backup before you start, just in case): +``/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile``, +removing all occurrences of the string ``-arch ppc``, changing the line +``MACOSX_DEPLOYMENT_TARGET=10.3`` to ``MACOSX_DEPLOYMENT_TARGET=10.5`` and +changing the occurrences of ``MacOSX10.4u.sdk`` into ``MacOSX10.5.sdk`` + +2. In +``/Library/Frameworks/Python.framework/Versions/Current/lib/pythonX.Y/site-packages/easy-install.pth``, +(where X.Y is the version of Python you are building against) +Comment out the line containing the name of the directory in which the +previous version of MPL was installed (Looks something like ``./matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg``). + +3. Save the following as a shell script , for example ``./install-matplotlib-epd-osx.sh`` :: + + NAME=matplotlib + VERSION=0_99 + PREFIX=$HOME + #branch="release" + branch="trunk" + if [ $branch = "trunk" ] + then + echo getting the trunk + svn co https://matplotlib.svn.sourceforge.net/svnroot/$NAME/trunk/$NAME $NAME + cd $NAME + + fi + if [ $branch = "release" ] + then + echo getting the maintenance branch + svn co https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v${VERSION}_maint $NAME$VERSION + cd $NAME$VERSION + fi + export CFLAGS="-Os -arch i386" + export LDFLAGS="-Os -arch i386" + export PKG_CONFIG_PATH="/usr/x11/lib/pkgconfig" + export ARCHFLAGS="-arch i386" + python setup.py build + python setup.py install #--prefix=$PREFIX #Use this if you don't want it installed into your default location + cd .. + +Run this script (for example ``sh ./install-matplotlib-epd-osx.sh``) in the +directory in which you want the source code to be placed, or simply type the +commands in the terminal command line. This script sets some local variable +(CFLAGS, LDFLAGS, PKG_CONFIG_PATH, ARCHFLAGS), removes previous installations, +checks out the source from svn, builds and installs it. The backend seems to be +set to MacOSX. + + Windows questions ================= Property changes on: branches/mathtex/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,7428-7433,7442-7444,7446 /trunk/matplotlib/doc/pyplots/README:7265-7303,7308-7317,7321,7339-7478 + /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,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 /trunk/matplotlib/doc/pyplots/README:7265-7303,7308-7317,7321,7339-7478,7483-7723 Modified: branches/mathtex/doc/sphinxext/gen_gallery.py =================================================================== --- branches/mathtex/doc/sphinxext/gen_gallery.py 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/sphinxext/gen_gallery.py 2009年09月09日 14:47:09 UTC (rev 7724) @@ -18,6 +18,10 @@ multiimage = re.compile('(.*)_\d\d') +def out_of_date(original, derived): + return (not os.path.exists(derived) or + os.stat(derived).st_mtime < os.stat(original).st_mtime) + def gen_gallery(app, doctree): if app.builder.name != 'html': return @@ -58,10 +62,10 @@ # Create thumbnails based on images in tmpdir, and place # them within the build tree - image.thumbnail( - str(os.path.join(origdir, filename)), - str(os.path.join(thumbdir, filename)), - scale=0.3) + orig_path = str(os.path.join(origdir, filename)) + thumb_path = str(os.path.join(thumbdir, filename)) + if out_of_date(orig_path, thumb_path): + image.thumbnail(orig_path, thumb_path, scale=0.3) m = multiimage.match(basename) if m is None: Property changes on: branches/mathtex/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,7428-7433,7442-7444,7446 /trunk/matplotlib/doc/sphinxext/gen_gallery.py:7265-7303,7308-7317,7321,7339-7478 + /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,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 /trunk/matplotlib/doc/sphinxext/gen_gallery.py:7265-7303,7308-7317,7321,7339-7478,7483-7723 Modified: branches/mathtex/doc/sphinxext/gen_rst.py =================================================================== --- branches/mathtex/doc/sphinxext/gen_rst.py 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/sphinxext/gen_rst.py 2009年09月09日 14:47:09 UTC (rev 7724) @@ -113,8 +113,7 @@ fhsubdirIndex.write(' %s\n'%rstfile) - if (not out_of_date(fullpath, outputfile) and - not out_of_date(fullpath, outrstfile)): + if not out_of_date(fullpath, outrstfile): continue fh = file(outrstfile, 'w') Property changes on: branches/mathtex/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,7428-7433,7442-7444,7446 /trunk/matplotlib/doc/sphinxext/gen_rst.py:7265-7303,7308-7317,7321,7339-7478 + /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,7442-7444,7446,7475-7482,7484,7486,7489-7523,7567,7569,7582-7584,7616-7618,7633,7638,7703 /trunk/matplotlib/doc/sphinxext/gen_rst.py:7265-7303,7308-7317,7321,7339-7478,7483-7723 Deleted: branches/mathtex/doc/users/annotations.rst =================================================================== --- branches/mathtex/doc/users/annotations.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/users/annotations.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -1,87 +0,0 @@ -.. _annotations-tutorial: - -Annotating text -=============== - -For a more detailed introduction to annotations, see -:ref:`plotting-guide-annotation`. - -The uses of the basic :func:`~matplotlib.pyplot.text` command above -place text at an arbitrary position on the Axes. A common use case of -text is to annotate some feature of the plot, and the -:func:`~matplotlib.Axes.annotate` method provides helper functionality -to make annotations easy. In an annotation, there are two points to -consider: the location being annotated represented by the argument -``xy`` and the location of the text ``xytext``. Both of these -arguments are ``(x,y)`` tuples. - -.. plot:: pyplots/annotation_basic.py - :include-source: - - -In this example, both the ``xy`` (arrow tip) and ``xytext`` locations -(text location) are in data coordinates. There are a variety of other -coordinate systems one can choose -- you can specify the coordinate -system of ``xy`` and ``xytext`` with one of the following strings for -``xycoords`` and ``textcoords`` (default is 'data') - -==================== ==================================================== -argument coordinate system -==================== ==================================================== - 'figure points' points from the lower left corner of the figure - 'figure pixels' pixels from the lower left corner of the figure - 'figure fraction' 0,0 is lower left of figure and 1,1 is upper, right - 'axes points' points from lower left corner of axes - 'axes pixels' pixels from lower left corner of axes - 'axes fraction' 0,1 is lower left of axes and 1,1 is upper right - 'data' use the axes data coordinate system -==================== ==================================================== - -For example to place the text coordinates in fractional axes -coordinates, one could do:: - - ax.annotate('local max', xy=(3, 1), xycoords='data', - xytext=(0.8, 0.95), textcoords='axes fraction', - arrowprops=dict(facecolor='black', shrink=0.05), - horizontalalignment='right', verticalalignment='top', - ) - -For physical coordinate systems (points or pixels) the origin is the -(bottom, left) of the figure or axes. If the value is negative, -however, the origin is from the (right, top) of the figure or axes, -analogous to negative indexing of sequences. - -Optionally, you can specify arrow properties which draws an arrow -from the text to the annotated point by giving a dictionary of arrow -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`, - 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 -fractional figure coordinate system. :class:`matplotlib.text.Text` -keyword args like ``horizontalalignment``, ``verticalalignment`` and -``fontsize are passed from the `~matplotlib.Axes.annotate` to the -``Text`` instance - -.. 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`. - Modified: branches/mathtex/doc/users/artists.rst =================================================================== --- branches/mathtex/doc/users/artists.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/users/artists.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -37,7 +37,7 @@ :class:`~matplotlib.text.Text`, :class:`~matplotlib.patches.Rectangle`, :class:`~matplotlib.image.Image`, respectively). These helper methods -will take your data (eg. ``numpy`` arrays and strings) create +will take your data (eg. ``numpy`` arrays and strings) and create primitive ``Artist`` instances as needed (eg. ``Line2D``), add them to the relevant containers, and draw them when requested. Most of you are probably familiar with the :class:`~matplotlib.axes.Subplot`, Modified: branches/mathtex/doc/users/event_handling.rst =================================================================== --- branches/mathtex/doc/users/event_handling.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/users/event_handling.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -5,7 +5,7 @@ ************************** matplotlib works with 6 user interface toolkits (wxpython, tkinter, -qt, gtk, fltk abd macosx) and in order to support features like interactive +qt, gtk, fltk and macosx) and in order to support features like interactive panning and zooming of figures, it is helpful to the developers to have an API for interacting with the figure via key presses and mouse movements that is "GUI neutral" so we don't have to repeat a lot of @@ -150,7 +150,7 @@ Write draggable rectangle class that is initialized with a :class:`~matplotlib.patches.Rectangle` instance but will move its x,y -location when dragged. Hint: you will need to store the orginal +location when dragged. Hint: you will need to store the original ``xy`` location of the rectangle which is stored as rect.xy and connect to the press, motion and release mouse events. When the mouse is pressed, check to see if the click occurs over your rectangle (see Modified: branches/mathtex/doc/users/index.rst =================================================================== --- branches/mathtex/doc/users/index.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/users/index.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -19,9 +19,14 @@ customizing.rst shell.rst index_text.rst + image_tutorial.rst artists.rst + legend_guide.rst event_handling.rst - plotting.rst + legend.rst + transforms_tutorial.rst + path_tutorial.rst + annotations_guide.rst toolkits.rst screenshots.rst whats_new.rst Modified: branches/mathtex/doc/users/index_text.rst =================================================================== --- branches/mathtex/doc/users/index_text.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/users/index_text.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -9,6 +9,6 @@ text_props.rst mathtext.rst usetex.rst - annotations.rst + annotations_intro.rst Modified: branches/mathtex/doc/users/installing.rst =================================================================== --- branches/mathtex/doc/users/installing.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/users/installing.rst 2009年09月09日 14:47:09 UTC (rev 7724) @@ -22,7 +22,7 @@ One single click installer and you are done. -Ok, so you want to do it the hard way? +OK, so you want to do it the hard way? ====================================== For some people, the prepackaged pythons discussed above are not an @@ -109,7 +109,7 @@ packaging matplotlib. -.. _install_requrements: +.. _install_requirements: Build requirements ================== @@ -152,7 +152,7 @@ The Qt3 widgets library python wrappers for the QtAgg backend :term:`pyqt` 4.0 or later - The Qt4 widgets library python wrappersfor the Qt4Agg backend + The Qt4 widgets library python wrappers for the Qt4Agg backend :term:`pygtk` 2.2 or later The python wrappers for the GTK widgets library for use with the GTK or GTKAgg backend @@ -201,5 +201,5 @@ instruction in the README. This directory has a Makefile which will automatically grab the zlib, png and freetype dependencies from the web, build them with the right flags to make universal libraries, and -then build the matplotlib source and binary installers. - \ No newline at end of file +then build the matplotlib source and binary installers. + Modified: branches/mathtex/doc/users/license.rst =================================================================== --- branches/mathtex/doc/users/license.rst 2009年09月08日 18:16:38 UTC (rev 7723) +++ branches/mathtex/doc/users/license.rst 2... [truncated message content]