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
|
|
From: <cm...@us...> - 2008-12-10 03:01:19
|
Revision: 6537
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6537&view=rev
Author: cmoad
Date: 2008-12-10 03:01:14 +0000 (Wed, 10 Dec 2008)
Log Message:
-----------
tagging new release
Added Paths:
-----------
tags/v0_98_4/
tags/v0_98_4/CHANGELOG
tags/v0_98_4/lib/matplotlib/__init__.py
Removed Paths:
-------------
tags/v0_98_4/CHANGELOG
tags/v0_98_4/lib/matplotlib/__init__.py
Deleted: tags/v0_98_4/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-09 12:27:51 UTC (rev 6535)
+++ tags/v0_98_4/CHANGELOG 2008-12-10 03:01:14 UTC (rev 6537)
@@ -1,3971 +0,0 @@
-2008-12-08 Added mdehoon's native macosx backend from sf patch 2179017 - JDH
-
-2008-12-08 Removed the prints in the set_*style commands. Return the
- list of pprinted strings instead - JDH
-
-2008-12-08 Some of the changes Michael made to improve the output of
- the property tables in the rest docs broke of made
- difficult to use some of the interactive doc helpers, eg
- setp and getp. Having all the rest markup in the ipython
- shell also confused the docstrings. I added a new rc param
- docstring.harcopy, to format the docstrings differently for
- hardcopy and other use. Ther ArtistInspector could use a
- little refactoring now since there is duplication of effort
- between the rest out put and the non-rest output - JDH
-
-2008-12-08 Updated spectral methods (psd, csd, etc.) to scale one-sided
- densities by a factor of 2 and, optionally, scale all densities
- by the sampling frequency. This gives better MatLab
- compatibility. -RM
-
-2008-12-08 Fixed alignment of ticks in colorbars. -MGD
-
-2008-12-07 drop the deprecated "new" keyword of np.histogram() for
- numpy 1.2 or later. -JJL
-
-2008-12-06 Fixed a bug in svg backend that new_figure_manager()
- ignores keywords arguments such as figsize, etc. -JJL
-
-2008-12-05 Fixed a bug that the handlelength of the new legend class
- set too short when numpoints=1 -JJL
-
-2008-12-04 Added support for data with units (e.g. dates) to
- Axes.fill_between. -RM
-
-2008-12-04 Added fancybox keyword to legend. Also applied some changes
- for better look, including baseline adjustment of the
- multiline texts so that it is center aligned. -JJL
-
-2008-12-02 The transmuter classes in the patches.py are reorganized as
- subclasses of the Style classes. A few more box and arrow
- styles are added. -JJL
-
-2008-12-02 Fixed a bug in the new legend class that didn't allowed
- a tuple of coordinate vlaues as loc. -JJL
-
-2008-12-02 Improve checks for external dependencies, using subprocess
- (instead of deprecated popen*) and distutils (for version
- checking) - DSD
-
-2008-11-30 Reimplementaion of the legend which supports baseline alignement,
- multi-column, and expand mode. - JJL
-
-2008-12-01 Fixed histogram autoscaling bug when bins or range are given
- explicitly (fixes Debian bug 503148) - MM
-
-2008-11-25 Added rcParam axes.unicode_minus which allows plain hypen
- for minus when False - JDH
-
-2008-11-25 Added scatterpoints support in Legend. patch by Erik
- Tollerud - JJL
-
-2008-11-24 Fix crash in log ticking. - MGD
-
-2008-11-20 Added static helper method BrokenHBarCollection.span_where
- and Axes/pyplot method fill_between. See
- examples/pylab/fill_between.py - JDH
-
-2008-11-12 Add x_isdata and y_isdata attributes to Artist instances,
- and use them to determine whether either or both
- coordinates are used when updating dataLim. This is
- used to fix autoscaling problems that had been triggered
- by axhline, axhspan, axvline, axvspan. - EF
-
-2008-11-11 Update the psd(), csd(), cohere(), and specgram() methods
- of Axes and the csd() cohere(), and specgram() functions
- in mlab to be in sync with the changes to psd().
- In fact, under the hood, these all call the same core
- to do computations. - RM
-
-2008-11-11 Add 'pad_to' and 'sides' parameters to mlab.psd() to
- allow controlling of zero padding and returning of
- negative frequency components, respecitively. These are
- added in a way that does not change the API. - RM
-
-2008-11-10 Fix handling of c kwarg by scatter; generalize
- is_string_like to accept numpy and numpy.ma string
- array scalars. - RM and EF
-
-2008-11-09 Fix a possible EINTR problem in dviread, which might help
- when saving pdf files from the qt backend. - JKS
-
-2008-11-05 Fix bug with zoom to rectangle and twin axes - MGD
-
-2008-10-24 Added Jae Joon's fancy arrow, box and annotation
- enhancements -- see
- examples/pylab_examples/annotation_demo2.py
-
-2008-10-23 Autoscaling is now supported with shared axes - EF
-
-2008-10-23 Fixed exception in dviread that happened with Minion - JKS
-
-2008-10-21 set_xlim, ylim now return a copy of the viewlim array to
- avoid modify inplace surprises
-
-2008-10-20 Added image thumbnail generating function
- matplotlib.image.thumbnail. See
- examples/misc/image_thumbnail.py - JDH
-
-2008-10-20 Applied scatleg patch based on ideas and work by Erik
- Tollerud and Jae-Joon Lee. - MM
-
-2008-10-11 Fixed bug in pdf backend: if you pass a file object for
- output instead of a filename, e.g. in a wep app, we now
- flush the object at the end. - JKS
-
-2008-10-08 Add path simplification support to paths with gaps. - EF
-
-2008-10-05 Fix problem with AFM files that don't specify the font's
- full name or family name. - JKS
-
-2008-10-04 Added 'scilimits' kwarg to Axes.ticklabel_format() method,
- for easy access to the set_powerlimits method of the
- major ScalarFormatter. - EF
-
-2008-10-04 Experimental new kwarg borderpad to replace pad in legend,
- based on suggestion by Jae-Joon Lee. - EF
-
-2008-09-27 Allow spy to ignore zero values in sparse arrays, based
- on patch by Tony Yu. Also fixed plot to handle empty
- data arrays, and fixed handling of markers in figlegend. - EF
-
-2008-09-24 Introduce drawstyles for lines. Transparently split linestyles
- like 'steps--' into drawstyle 'steps' and linestyle '--'.
- Legends always use drawstyle 'default'. - MM
-
-2008-09-18 Fixed quiver and quiverkey bugs (failure to scale properly
- when resizing) and added additional methods for determining
- the arrow angles - EF
-
-2008-09-18 Fix polar interpolation to handle negative values of theta - MGD
-
-2008-09-14 Reorganized cbook and mlab methods related to numerical
- calculations that have little to do with the goals of those two
- modules into a separate module numerical_methods.py
- Also, added ability to select points and stop point selection
- with keyboard in ginput and manual contour labeling code.
- Finally, fixed contour labeling bug. - DMK
-
-2008-09-11 Fix backtick in Postscript output. - MGD
-
-2008-09-10 [ 2089958 ] Path simplification for vector output backends
- Leverage the simplification code exposed through
- path_to_polygons to simplify certain well-behaved paths in
- the vector backends (PDF, PS and SVG). "path.simplify"
- must be set to True in matplotlibrc for this to work. -
- MGD
-
-2008-09-10 Add "filled" kwarg to Path.intersects_path and
- Path.intersects_bbox. - MGD
-
-2008-09-07 Changed full arrows slightly to avoid an xpdf rendering
- problem reported by Friedrich Hagedorn. - JKS
-
-2008-09-07 Fix conversion of quadratic to cubic Bezier curves in PDF
- and PS backends. Patch by Jae-Joon Lee. - JKS
-
-2008-09-06 Added 5-point star marker to plot command - EF
-
-2008-09-05 Fix hatching in PS backend - MGD
-
-2008-09-03 Fix log with base 2 - MGD
-
-2008-09-01 Added support for bilinear interpolation in
- NonUniformImage; patch by Gregory Lielens. - EF
-
-2008-08-28 Added support for multiple histograms with data of
- different length - MM
-
-2008-08-28 Fix step plots with log scale - MGD
-
-2008-08-28 Fix masked arrays with markers in non-Agg backends - MGD
-
-2008-08-28 Fix clip_on kwarg so it actually works correctly - MGD
-
-2008-08-25 Fix locale problems in SVG backend - MGD
-
-2008-08-22 fix quiver so masked values are not plotted - JSW
-
-2008-08-18 improve interactive pan/zoom in qt4 backend on windows - DSD
-
-2008-08-11 Fix more bugs in NaN/inf handling. In particular, path simplification
- (which does not handle NaNs or infs) will be turned off automatically
- when infs or NaNs are present. Also masked arrays are now converted
- to arrays with NaNs for consistent handling of masks and NaNs
- - MGD and EF
-
-=================================================================
-2008-08-03 Released 0.98.3 at svn r5947
-
-2008-08-01 Backported memory leak fixes in _ttconv.cpp - MGD
-
-2008-07-31 Added masked array support to griddata. - JSW
-
-2008-07-26 Added optional C and reduce_C_function arguments to
- axes.hexbin(). This allows hexbin to accumulate the values
- of C based on the x,y coordinates and display in hexagonal
- bins. - ADS
-
-2008-07-24 Deprecated (raise NotImplementedError) all the mlab2
- functions from matplotlib.mlab out of concern that some of
- them were not clean room implementations. JDH
-
-2008-07-24 Rewrite of a significant portion of the clabel code (class
- ContourLabeler) to improve inlining. - DMK
-
-2008-07-22 Added Barbs polygon collection (similar to Quiver) for plotting
- wind barbs. Added corresponding helpers to Axes and pyplot as
- well. (examples/pylab_examples/barb_demo.py shows it off.) - RMM
-
-2008-07-21 Added scikits.delaunay as matplotlib.delaunay. Added griddata
- function in matplotlib.mlab, with example (griddata_demo.py) in
- pylab_examples. griddata function will use mpl_toolkits._natgrid
- if installed. - JSW
-
-2008-07-21 Re-introduced offset_copy that works in the context of the
- new transforms. - MGD
-
-2008-07-21 Committed patch by Ryan May to add get_offsets and
- set_offsets to Collections base class - EF
-
-2008-07-21 Changed the "asarray" strategy in image.py so that
- colormapping of masked input should work for all
- image types (thanks Klaus Zimmerman) - EF
-
-2008-07-20 Rewrote cbook.delete_masked_points and corresponding
- unit test to support rgb color array inputs, datetime
- inputs, etc. - EF
-
-2008-07-20 Renamed unit/axes_unit.py to cbook_unit.py and modified
- in accord with Ryan's move of delete_masked_points from
- axes to cbook. - EF
-
-2008-07-18 Check for nan and inf in axes.delete_masked_points().
- This should help hexbin and scatter deal with nans. - ADS
-
-2008-07-17 Added ability to manually select contour label locations.
- Also added a waitforbuttonpress function. - DMK
-
-2008-07-17 Fix bug with NaNs at end of path (thanks, Andrew Straw for
- the report) - MGD
-
-2008-07-16 Improve error handling in texmanager, thanks to Ian Henry
- for reporting - DSD
-
-2008-07-12 Added support for external backends with the
- "module://my_backend" syntax - JDH
-
-2008-07-11 Fix memory leak related to shared axes. Grouper should
- store weak references. - MGD
-
-2008-07-10 Bugfix: crash displaying fontconfig pattern - MGD
-
-2008-07-10 Bugfix: [ 2013963 ] update_datalim_bounds in Axes not works - MGD
-
-2008-07-10 Bugfix: [ 2014183 ] multiple imshow() causes gray edges - MGD
-
-2008-07-09 Fix rectangular axes patch on polar plots bug - MGD
-
-2008-07-09 Improve mathtext radical rendering - MGD
-
-2008-07-08 Improve mathtext superscript placement - MGD
-
-2008-07-07 Fix custom scales in pcolormesh (thanks Matthew Turk) - MGD
-
-2008-07-03 Implemented findobj method for artist and pyplot - see
- examples/pylab_examples/findobj_demo.py - JDH
-
-2008-06-30 Another attempt to fix TextWithDash - DSD
-
-2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to
- have been unnecessary and caused a bug reported by P.
- Raybaut - DSD
-
-2008-06-27 Fixed tick positioning bug - MM
-
-2008-06-27 Fix dashed text bug where text was at the wrong end of the
- dash - MGD
-
-2008-06-26 Fix mathtext bug for expressions like $x_{\leftarrow}$ - MGD
-
-2008-06-26 Fix direction of horizontal/vertical hatches - MGD
-
-2008-06-25 Figure.figurePatch renamed Figure.patch, Axes.axesPatch
- renamed Axes.patch, Axes.axesFrame renamed Axes.frame,
- Axes.get_frame, which returns Axes.patch, is deprecated.
- Examples and users guide updated - JDH
-
-2008-06-25 Fix rendering quality of pcolor - MGD
-
-=================================================================
-2008-06-24 Released 0.98.2 at svn r5667 - (source only for debian) JDH
-
-2008-06-24 Added "transparent" kwarg to savefig. - MGD
-
-2008-06-24 Applied Stefan's patch to draw a single centered marker over
- a line with numpoints==1 - JDH
-
-2008-06-23 Use splines to render circles in scatter plots - MGD
-
-===============================================================
-2008-06-22 Released 0.98.1 at revision 5637
-
-2008-06-22 Removed axes3d support and replaced it with a
- NotImplementedError for one release cycle
-
-2008-06-21 fix marker placement bug in backend_ps - DSD
-
-2008-06-20 [ 1978629 ] scale documentation missing/incorrect for log - MGD
-
-2008-06-20 Added closed kwarg to PolyCollection. Fixes bug [ 1994535
- ] still missing lines on graph with svn (r 5548). - MGD
-
-2008-06-20 Added set/get_closed method to Polygon; fixes error
- in hist - MM
-
-2008-06-19 Use relative font sizes (e.g. 'medium' and 'large') in
- rcsetup.py and matplotlibrc.template so that text will
- be scaled by default when changing rcParams['font.size'] -
- EF
-
-2008-06-17 Add a generic PatchCollection class that can contain any
- kind of patch. - MGD
-
-2008-06-13 Change pie chart label alignment to avoid having labels
- overwrite the pie - MGD
-
-2008-06-12 Added some helper functions to the mathtext parser to
- return bitmap arrays or write pngs to make it easier to use
- mathtext outside the context of an mpl figure. modified
- the mathpng sphinxext to use the mathtext png save
- functionality - see examples/api/mathtext_asarray.py - JDH
-
-2008-06-11 Use matplotlib.mathtext to render math expressions in
- online docs - MGD
-
-2008-06-11 Move PNG loading/saving to its own extension module, and
- remove duplicate code in _backend_agg.cpp and _image.cpp
- that does the same thing - MGD
-
-2008-06-11 Numerous mathtext bugfixes, primarily related to
- dpi-independence - MGD
-
-2008-06-10 Bar now applies the label only to the first patch only, and
- sets '_nolegend_' for the other patch labels. This lets
- autolegend work as expected for hist and bar - see
- https://sourceforge.net/tracker/index.php?func=detail&aid=1986597&group_id=80706&atid=560720
- JDH
-
-2008-06-10 Fix text baseline alignment bug. [ 1985420 ] Repair of
- baseline alignment in Text._get_layout. Thanks Stan West -
- MGD
-
-2008-06-09 Committed Gregor's image resample patch to downsampling
- images with new rcparam image.resample - JDH
-
-2008-06-09 Don't install Enthought.Traits along with matplotlib. For
- matplotlib developers convenience, it can still be
- installed by setting an option in setup.cfg while we figure
- decide if there is a future for the traited config - DSD
-
-2008-06-09 Added range keyword arg to hist() - MM
-
-2008-06-07 Moved list of backends to rcsetup.py; made use of lower
- case for backend names consistent; use validate_backend
- when importing backends subpackage - EF
-
-2008-06-06 hist() revision, applied ideas proposed by Erik Tollerud and
- Olle Engdegard: make histtype='step' unfilled by default
- and introduce histtype='stepfilled'; use default color
- cycle; introduce reverse cumulative histogram; new align
- keyword - MM
-
-2008-06-06 Fix closed polygon patch and also provide the option to
- not close the polygon - MGD
-
-2008-06-05 Fix some dpi-changing-related problems with PolyCollection,
- as called by Axes.scatter() - MGD
-
-2008-06-05 Fix image drawing so there is no extra space to the right
- or bottom - MGD
-
-2006-06-04 Added a figure title command subtitle as a Figure method
- and pyplot command -- see examples/figure_title.py - JDH
-
-2008-06-02 Added support for log to hist with histtype='step' and fixed
- a bug for log-scale stacked histograms - MM
-
-===============================================================
-2008-05-29 Released 0.98.0 at revision 5314
-
-2008-05-29 matplotlib.image.imread now no longer always returns RGBA
- -- if the image is luminance or RGB, it will return a MxN
- or MxNx3 array if possible. Also uint8 is no longer always
- forced to float.
-
-2008-05-29 Implement path clipping in PS backend - JDH
-
-2008-05-29 Fixed two bugs in texmanager.py:
- improved comparison of dvipng versions
- fixed a bug introduced when get_grey method was added
- - DSD
-
-2008-05-28 Fix crashing of PDFs in xpdf and ghostscript when two-byte
- characters are used with Type 3 fonts - MGD
-
-2008-05-28 Allow keyword args to configure widget properties as
- requested in
- http://sourceforge.net/tracker/index.php?func=detail&aid=1866207&group_id=80706&atid=560722
- - JDH
-
-2008-05-28 Replaced '-' with u'\u2212' for minus sign as requested in
- http://sourceforge.net/tracker/index.php?func=detail&aid=1962574&group_id=80706&atid=560720
-
-2008-05-28 zero width/height Rectangles no longer influence the
- autoscaler. Useful for log histograms with empty bins -
- JDH
-
-2008-05-28 Fix rendering of composite glyphs in Type 3 conversion
- (particularly as evidenced in the Eunjin.ttf Korean font)
- Thanks Jae-Joon Lee for finding this!
-
-2008-05-27 Rewrote the cm.ScalarMappable callback infrastructure to
- use cbook.CallbackRegistry rather than custom callback
- handling. Amy users of add_observer/notify of the
- cm.ScalarMappable should uae the
- cm.ScalarMappable.callbacksSM CallbackRegistry instead. JDH
-
-2008-05-27 Fix TkAgg build on Ubuntu 8.04 (and hopefully a more
- general solution for other platforms, too.)
-
-2008-05-24 Added PIL support for loading images to imread (if PIL is
- available) - JDH
-
-2008-05-23 Provided a function and a method for controlling the
- plot color cycle. - EF
-
-2008-05-23 Major revision of hist(). Can handle 2D arrays and create
- stacked histogram plots; keyword 'width' deprecated and
- rwidth (relative width) introduced; align='edge' changed
- to center of bin - MM
-
-2008-05-22 Added support for ReST-based doumentation using Sphinx.
- Documents are located in doc/, and are broken up into
- a users guide and an API reference. To build, run the
- make.py files. Sphinx-0.4 is needed to build generate xml,
- which will be useful for rendering equations with mathml,
- use sphinx from svn until 0.4 is released - DSD
-
-2008-05-21 Fix segfault in TkAgg backend - MGD
-
-2008-05-21 Fix a "local variable unreferenced" bug in plotfile - MM
-
-2008-05-19 Fix crash when Windows can not access the registry to
- determine font path [Bug 1966974, thanks Patrik Simons] - MGD
-
-2008-05-16 removed some unneeded code w/ the python 2.4 requirement.
- cbook no longer provides compatibility for reversed,
- enumerate, set or izip. removed lib/subprocess, mpl1,
- sandbox/units, and the swig code. This stuff should remain
- on the maintenance branch for archival purposes. JDH
-
-2008-05-16 Reorganized examples dir - JDH
-
-2008-05-16 Added 'elinewidth' keyword arg to errorbar, based on patch
- by Christopher Brown - MM
-
-2008-05-16 Added 'cumulative' keyword arg to hist to plot cumulative
- histograms. For normed hists, this is normalized to one - MM
-
-2008-05-15 Fix Tk backend segfault on some machines - MGD
-
-2008-05-14 Don't use stat on Windows (fixes font embedding problem) - MGD
-
-2008-05-09 Fix /singlequote (') in Postscript backend - MGD
-
-2008-05-08 Fix kerning in SVG when embedding character outlines - MGD
-
-2008-05-07 Switched to future numpy histogram semantic in hist - MM
-
-2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD
-
-2008-05-05 pass notify_axes_change to the figure's add_axobserver
- in the qt backends, like we do for the other backends.
- Thanks Glenn Jones for the report - DSD
-
-2008-05-02 Added step histograms, based on patch by Erik Tollerud. - MM
-
-2008-05-02 On PyQt <= 3.14 there is no way to determine the underlying
- Qt version. [1851364] - MGD
-
-2008-05-02 Don't call sys.exit() when pyemf is not found [1924199] -
- MGD
-
-2008-05-02 Update _subprocess.c from upstream Python 2.5.2 to get a
- few memory and reference-counting-related bugfixes. See
- bug 1949978. - MGD
-
-2008-04-30 Added some record array editing widgets for gtk -- see
- examples/rec_edit*.py - JDH
-
-2008-04-29 Fix bug in mlab.sqrtm - MM
-
-2008-04-28 Fix bug in SVG text with Mozilla-based viewers (the symbol
- tag is not supported) - MGD
-
-2008-04-27 Applied patch by Michiel de Hoon to add hexbin
- axes method and pyplot function - EF
-
-2008-04-25 Enforce python >= 2.4; remove subprocess build - EF
-
-2008-04-25 Enforce the numpy requirement at build time - JDH
-
-2008-04-24 Make numpy 1.1 and python 2.3 required when importing
- matplotlib - EF
-
-2008-04-24 Fix compilation issues on VS2003 (Thanks Martin Spacek for
- all the help) - MGD
-
-2008-04-24 Fix sub/superscripts when the size of the font has been
- changed - MGD
-
-2008-04-22 Use "svg.embed_char_paths" consistently everywhere - MGD
-
-2008-04-20 Add support to MaxNLocator for symmetric axis autoscaling. - EF
-
-2008-04-20 Fix double-zoom bug. - MM
-
-2008-04-15 Speed up color mapping. - EF
-
-2008-04-12 Speed up zooming and panning of dense images. - EF
-
-2008-04-11 Fix global font rcParam setting after initialization
- time. - MGD
-
-2008-04-11 Revert commits 5002 and 5031, which were intended to
- avoid an unnecessary call to draw(). 5002 broke saving
- figures before show(). 5031 fixed the problem created in
- 5002, but broke interactive plotting. Unnecessary call to
- draw still needs resolution - DSD
-
-2008-04-07 Improve color validation in rc handling, suggested
- by Lev Givon - EF
-
-2008-04-02 Allow to use both linestyle definition arguments, '-' and
- 'solid' etc. in plots/collections - MM
-
-2008-03-27 Fix saving to Unicode filenames with Agg backend
- (other backends appear to already work...)
- (Thanks, Christopher Barker) - MGD
-
-2008-03-26 Fix SVG backend bug that prevents copying and pasting in
- Inkscape (thanks Kaushik Ghose) - MGD
-
-2008-03-24 Removed an unnecessary call to draw() in the backend_qt*
- mouseReleaseEvent. Thanks to Ted Drain - DSD
-
-2008-03-23 Fix a pdf backend bug which sometimes caused the outermost
- gsave to not be balanced with a grestore. - JKS
-
-2008-03-20 Fixed a minor bug in ContourSet._process_linestyles when
- len(linestyles)==Nlev - MM
-
-2008-03-19 Changed ma import statements to "from numpy import ma";
- this should work with past and future versions of
- numpy, whereas "import numpy.ma as ma" will work only
- with numpy >= 1.05, and "import numerix.npyma as ma"
- is obsolete now that maskedarray is replacing the
- earlier implementation, as of numpy 1.05.
-
-2008-03-14 Removed an apparently unnecessary call to
- FigureCanvasAgg.draw in backend_qt*agg. Thanks to Ted
- Drain - DSD
-
-2008-03-10 Workaround a bug in backend_qt4agg's blitting due to a
- buffer width/bbox width mismatch in _backend_agg's
- copy_from_bbox - DSD
-
-2008-02-29 Fix class Wx toolbar pan and zoom functions (Thanks Jeff
- Peery) - MGD
-
-2008-02-16 Added some new rec array functionality to mlab
- (rec_summarize, rec2txt and rec_groupby). See
- examples/rec_groupby_demo.py. Thanks to Tim M for rec2txt.
-
-2008-02-12 Applied Erik Tollerud's span selector patch - JDH
-
-2008-02-11 Update plotting() doc string to refer to getp/setp. - JKS
-
-2008-02-10 Fixed a problem with square roots in the pdf backend with
- usetex. - JKS
-
-2008-02-08 Fixed minor __str__ bugs so getp(gca()) works. - JKS
-
-2008-02-05 Added getters for title, xlabel, ylabel, as requested
- by Brandon Kieth - EF
-
-2008-02-05 Applied Gael's ginput patch and created
- examples/ginput_demo.py - JDH
-
-2008-02-03 Expose interpnames, a list of valid interpolation
- methods, as an AxesImage class attribute. - EF
-
-2008-02-03 Added BoundaryNorm, with examples in colorbar_only.py
- and image_masked.py. - EF
-
-2008-02-03 Force dpi=72 in pdf backend to fix picture size bug. - JKS
-
-2008-02-01 Fix doubly-included font problem in Postscript backend - MGD
-
-2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD
-
-2008-01-31 Don't use unicode strings with usetex by default - DSD
-
-2008-01-31 Fix text spacing problems in PDF backend with *some* fonts,
- such as STIXGeneral.
-
-2008-01-31 Fix \sqrt with radical number (broken by making [ and ]
- work below) - MGD
-
-2008-01-27 Applied Martin Teichmann's patch to improve the Qt4
- backend. Uses Qt's builtin toolbars and statusbars.
- See bug 1828848 - DSD
-
-2008-01-10 Moved toolkits to mpl_toolkits, made mpl_toolkits
- a namespace package - JSWHIT
-
-2008-01-10 Use setup.cfg to set the default parameters (tkagg,
- numpy) when building windows installers - DSD
-
-2008-01-10 Fix bug displaying [ and ] in mathtext - MGD
-
-2008-01-10 Fix bug when displaying a tick value offset with scientific
- notation. (Manifests itself as a warning that the \times
- symbol can not be found). - MGD
-
-2008-01-10 Use setup.cfg to set the default parameters (tkagg,
- numpy) when building windows installers - DSD
-
-===============================================================
-2008-01-06 Released 0.91.2 at revision 4802
-
-2007-12-26 Reduce too-late use of matplotlib.use() to a warning
- instead of an exception, for backwards compatibility - EF
-
-2007-12-25 Fix bug in errorbar, identified by Noriko Minakawa - EF
-
-2007-12-25 Changed masked array importing to work with the upcoming
- numpy 1.05 (now the maskedarray branch) as well as with
- earlier versions. - EF
-
-2007-12-16 rec2csv saves doubles without losing precision. Also, it
- does not close filehandles passed in open. - JDH,ADS
-
-2007-12-13 Moved rec2gtk to matplotlib.toolkits.gtktools and rec2excel
- to matplotlib.toolkits.exceltools - JDH
-
-2007-12-12 Support alpha-blended text in the Agg and Svg backends -
- MGD
-
-2007-12-10 Fix SVG text rendering bug. - MGD
-
-2007-12-10 Increase accuracy of circle and ellipse drawing by using an
- 8-piece bezier approximation, rather than a 4-piece one.
- Fix PDF, SVG and Cairo backends so they can draw paths
- (meaning ellipses as well). - MGD
-
-2007-12-07 Issue a warning when drawing an image on a non-linear axis. - MGD
-
-2007-12-06 let widgets.Cursor initialize to the lower x and y bounds
- rather than 0,0, which can cause havoc for dates and other
- transforms - DSD
-
-2007-12-06 updated references to mpl data directories for py2exe - DSD
-
-2007-12-06 fixed a bug in rcsetup, see bug 1845057 - DSD
-
-2007-12-05 Fix how fonts are cached to avoid loading the same one multiple times.
- (This was a regression since 0.90 caused by the refactoring of
- font_manager.py) - MGD
-
-2007-12-05 Support arbitrary rotation of usetex text in Agg backend. - MGD
-
-2007-12-04 Support '|' as a character in mathtext - MGD
-
-===============================================================
-2007-11-27 Released 0.91.1 at revision 4517
-
-===============================================================
-2007-11-27 Released 0.91.0 at revision 4478
-
-2007-11-13 All backends now support writing to a file-like object, not
- just a regular file. savefig() can be passed a file-like
- object in place of a file path. - MGD
-
-2007-11-13 Improved the default backend selection at build time:
- SVG -> Agg -> TkAgg -> WXAgg -> GTK -> GTKAgg. The last usable
- backend in this progression will be chosen in the default
- config file. If a backend is defined in setup.cfg, that will
- be the default backend - DSD
-
-2007-11-13 Improved creation of default config files at build time for
- traited config package - DSD
-
-2007-11-12 Exposed all the build options in setup.cfg. These options are
- read into a dict called "options" by setupext.py. Also, added
- "-mpl" tags to the version strings for packages provided by
- matplotlib. Versions provided by mpl will be identified and
- updated on subsequent installs - DSD
-
-2007-11-12 Added support for STIX fonts. A new rcParam,
- mathtext.fontset, can be used to choose between:
-
- 'cm':
- The TeX/LaTeX Computer Modern fonts
-
- 'stix':
- The STIX fonts (see stixfonts.org)
-
- 'stixsans':
- The STIX fonts, using sans-serif glyphs by default
-
- 'custom':
- A generic Unicode font, in which case the mathtext font
- must be specified using mathtext.bf, mathtext.it,
- mathtext.sf etc.
-
- Added a new example, stix_fonts_demo.py to show how to access
- different fonts and unusual symbols.
-
- - MGD
-
-2007-11-12 Options to disable building backend extension modules moved
- from setup.py to setup.cfg - DSD
-
-2007-11-09 Applied Martin Teichmann's patch 1828813: a QPainter is used in
- paintEvent, which has to be destroyed using the method end(). If
- matplotlib raises an exception before the call to end - and it
- does if you feed it with bad data - this method end() is never
- called and Qt4 will start spitting error messages
-
-2007-11-09 Moved pyparsing back into matplotlib namespace. Don't use
- system pyparsing, API is too variable from one release
- to the next - DSD
-
-2007-11-08 Made pylab use straight numpy instead of oldnumeric
- by default - EF
-
-2007-11-08 Added additional record array utilites to mlab (rec2excel,
- rec2gtk, rec_join, rec_append_field, rec_drop_field) - JDH
-
-2007-11-08 Updated pytz to version 2007g - DSD
-
-2007-11-08 Updated pyparsing to version 1.4.8 - DSD
-
-2007-11-08 Moved csv2rec to recutils and added other record array
- utilities - JDH
-
-2007-11-08 If available, use existing pyparsing installation - DSD
-
-2007-11-07 Removed old enthought.traits from lib/matplotlib, added
- Gael Varoquaux's enthought.traits-2.6b1, which is stripped
- of setuptools. The package is installed to site-packages
- if not already available - DSD
-
-2007-11-05 Added easy access to minor tick properties; slight mod
- of patch by Pierre G-M - EF
-
-2007-11-02 Commited Phil Thompson's patch 1599876, fixes to Qt4Agg
- backend and qt4 blitting demo - DSD
-
-2007-11-02 Commited Phil Thompson's patch 1599876, fixes to Qt4Agg
- backend and qt4 blitting demo - DSD
-
-2007-10-31 Made log color scale easier to use with contourf;
- automatic level generation now works. - EF
-
-2007-10-29 TRANSFORMS REFACTORING
-
- The primary goal of this refactoring was to make it easier
- to extend matplotlib to support new kinds of projections.
- This is primarily an internal improvement, and the possible
- user-visible changes it allows are yet to come.
-
- The transformation framework was completely rewritten in
- Python (with Numpy). This will make it easier to add news
- kinds of transformations without writing C/C++ code.
-
- Transforms are composed into a 'transform tree', made of
- transforms whose value depends on other transforms (their
- children). When the contents of children change, their
- parents are automatically updated to reflect those changes.
- To do this an "invalidation" method is used: when children
- change, all of their ancestors are marked as "invalid".
- When the value of a transform is accessed at a later time,
- its value is recomputed only if it is invalid, otherwise a
- cached value may be used. This prevents unnecessary
- recomputations of transforms, and contributes to better
- interactive performance.
-
- The framework can be used for both affine and non-affine
- transformations. However, for speed, we want use the
- backend renderers to perform affine transformations
- whenever possible. Therefore, it is possible to perform
- just the affine or non-affine part of a transformation on a
- set of data. The affine is always assumed to occur after
- the non-affine. For any transform:
-
- full transform == non-affine + affine
-
- Much of the drawing has been refactored in terms of
- compound paths. Therefore, many methods have been removed
- from the backend interface and replaced with a a handful to
- draw compound paths. This will make updating the backends
- easier, since there is less to update. It also should make
- the backends more consistent in terms of functionality.
-
- User visible changes:
-
- - POLAR PLOTS: Polar plots are now interactively zoomable,
- and the r-axis labels can be interactively rotated.
- Straight line segments are now interpolated to follow the
- curve of the r-axis.
-
- - Non-rectangular clipping works in more backends and with
- more types of objects.
-
- - Sharing an axis across figures is now done in exactly
- the same way as sharing an axis between two axes in the
- same figure:
-
- fig1 = figure()
- fig2 = figure()
-
- ax1 = fig1.add_subplot(111)
- ax2 = fig2.add_subplot(111, sharex=ax1, sharey=ax1)
-
- - linestyles now include steps-pre, steps-post and
- steps-mid. The old step still works and is equivalent to
- step-pre.
-
- - Multiple line styles may be provided to a collection.
-
- See API_CHANGES for more low-level information about this
- refactoring.
-
-2007-10-24 Added ax kwarg to Figure.colorbar and pyplot.colorbar - EF
-
-2007-10-19 Removed a gsave/grestore pair surrounding _draw_ps, which
- was causing a loss graphics state info (see "EPS output
- problem - scatter & edgecolors" on mpl-dev, 2007-10-29)
- - DSD
-
-2007-10-15 Fixed a bug in patches.Ellipse that was broken for
- aspect='auto'. Scale free ellipses now work properly for
- equal and auto on Agg and PS, and they fall back on a
- polygonal approximation for nonlinear transformations until
- we convince oursleves that the spline approximation holds
- for nonlinear transformations. Added
- unit/ellipse_compare.py to compare spline with vertex
- approx for both aspects. JDH
-
-2007-10-05 remove generator expressions from texmanager and mpltraits.
- generator expressions are not supported by python-2.3 - DSD
-
-2007-10-01 Made matplotlib.use() raise an exception if called after
- backends has been imported. - EF
-
-2007-09-30 Modified update* methods of Bbox and Interval so they
- work with reversed axes. Prior to this, trying to
- set the ticks on a reversed axis failed with an
- uninformative error message. - EF
-
-2007-09-30 Applied patches to axes3d to fix index error problem - EF
-
-2007-09-24 Applied Eike Welk's patch reported on mpl-dev on 2007-09-22
- Fixes a bug with multiple plot windows in the qt backend,
- ported the changes to backend_qt4 as well - DSD
-
-2007-09-21 Changed cbook.reversed to yield the same result as the
- python reversed builtin - DSD
-
-2007-09-13 The usetex support in the pdf backend is more usable now,
- so I am enabling it. - JKS
-
-2007-09-12 Fixed a Axes.bar unit bug - JDH
-
-2007-09-10 Made skiprows=1 the default on csv2rec - JDH
-
-2007-09-09 Split out the plotting part of pylab and put it in
- pyplot.py; removed numerix from the remaining pylab.py,
- which imports everything from pyplot.py. The intention
- is that apart from cleanups, the result of importing
- from pylab is nearly unchanged, but there is the
- new alternative of importing from pyplot to get
- the state-engine graphics without all the numeric
- functions.
- Numpified examples; deleted two that were obsolete;
- modified some to use pyplot. - EF
-
-2007-09-08 Eliminated gd and paint backends - EF
-
-2007-09-06 .bmp file format is now longer an alias for .raw
-
-2007-09-07 Added clip path support to pdf backend. - JKS
-
-2007-09-06 Fixed a bug in the embedding of Type 1 fonts in PDF.
- Now it doesn't crash Preview.app. - JKS
-
-2007-09-06 Refactored image saving code so that all GUI backends can
- save most image types. See FILETYPES for a matrix of
- backends and their supported file types.
- Backend canvases should no longer write their own print_figure()
- method -- instead they should write a print_xxx method for
- each filetype they can output and add an entry to their
- class-scoped filetypes dictionary. - MGD
-
-2007-09-05 Fixed Qt version reporting in setupext.py - DSD
-
-2007-09-04 Embedding Type 1 fonts in PDF, and thus usetex support
- via dviread, sort of works. To test, enable it by
- renaming _draw_tex to draw_tex. - JKS
-
-2007-09-03 Added ability of errorbar show limits via caret or
- arrowhead ends on the bars; patch by Manual Metz. - EF
-
-2007-09-03 Created type1font.py, added features to AFM and FT2Font
- (see API_CHANGES), started work on embedding Type 1 fonts
- in pdf files. - JKS
-
-2007-09-02 Continued work on dviread.py. - JKS
-
-2007-08-16 Added a set_extent method to AxesImage, allow data extent
- to be modified after initial call to imshow - DSD
-
-2007-08-14 Fixed a bug in pyqt4 subplots-adjust. Thanks to
- Xavier Gnata for the report and suggested fix - DSD
-
-2007-08-13 Use pickle to cache entire fontManager; change to using
- font_manager module-level function findfont wrapper for
- the fontManager.findfont method - EF
-
-2007-08-11 Numpification and cleanup of mlab.py and some examples - EF
-
-2007-08-06 Removed mathtext2
-
-2007-07-31 Refactoring of distutils scripts.
- - Will not fail on the entire build if an optional Python
- package (e.g. Tkinter) is installed but its development
- headers are not (e.g. tk-devel). Instead, it will
- continue to build all other extensions.
- - Provide an overview at the top of the output to display
- what dependencies and their versions were found, and (by
- extension) what will be built.
- - Use pkg-config, when available, to find freetype2, since
- this was broken on Mac OS-X when using MacPorts in a non-
- standard location.
-
-2007-07-30 Reorganized configuration code to work with traited config
- objects. The new config system is located in the
- matplotlib.config package, but it is disabled by default.
- To enable it, set NEWCONFIG=True in matplotlib.__init__.py.
- The new configuration system will still use the old
- matplotlibrc files by default. To switch to the experimental,
- traited configuration, set USE_TRAITED_CONFIG=True in
- config.__init__.py.
-
-2007-07-29 Changed default pcolor shading to flat; added aliases
- to make collection kwargs agree with setter names, so
- updating works; related minor cleanups.
- Removed quiver_classic, scatter_classic, pcolor_classic. - EF
-
-2007-07-26 Major rewrite of mathtext.py, using the TeX box layout model.
-
- There is one (known) backward incompatible change. The
- font commands (\cal, \rm, \it, \tt) now behave as TeX does:
- they are in effect until the next font change command or
- the end of the grouping. Therefore uses of $\cal{R}$
- should be changed to ${\cal R}$. Alternatively, you may
- use the new LaTeX-style font commands (\mathcal, \mathrm,
- \mathit, \mathtt) which do affect the following group,
- eg. $\mathcal{R}$.
-
- Other new features include:
-
- - Math may be interspersed with non-math text. Any text
- with an even number of $'s (non-escaped) will be sent to
- the mathtext parser for layout.
-
- - Sub/superscripts are less likely to accidentally overlap.
-
- - Support for sub/superscripts in either order, eg. $x^i_j$
- and $x_j^i$ are equivalent.
-
- - Double sub/superscripts (eg. $x_i_j$) are considered
- ambiguous and raise an exception. Use braces to disambiguate.
-
- - $\frac{x}{y}$ can be used for displaying fractions.
-
- - $\sqrt[3]{x}$ can be used to display the radical symbol
- with a root number and body.
-
- - $\left(\frac{x}{y}\right)$ may be used to create
- parentheses and other delimiters that automatically
- resize to the height of their contents.
-
- - Spacing around operators etc. is now generally more like
- TeX.
-
- - Added support (and fonts) for boldface (\bf) and
- sans-serif (\sf) symbols.
-
- - Log-like function name shortcuts are supported. For
- example, $\sin(x)$ may be used instead of ${\rm sin}(x)$
-
- - Limited use of kerning for the easy case (same font)
-
- Behind the scenes, the pyparsing.py module used for doing
- the math parsing was updated to the latest stable version
- (1.4.6). A lot of duplicate code was refactored out of the
- Font classes.
-
- - MGD
-
-2007-07-19 completed numpification of most trivial cases - NN
-
-2007-07-19 converted non-numpy relicts throughout the code - NN
-
-2007-07-19 replaced the Python code in numerix/ by a minimal wrapper around
- numpy that explicitly mentions all symbols that need to be
- addressed for further numpification - NN
-
-2007-07-18 make usetex respect changes to rcParams. texmanager used to
- only configure itself when it was created, now it
- reconfigures when rcParams are changed. Thank you Alexander
- Schmolck for contributing a patch - DSD
-
-2007-07-17 added validation to setting and changing rcParams - DSD
-
-2007-07-17 bugfix segfault in transforms module. Thanks Ben North for
- the patch. - ADS
-
-2007-07-16 clean up some code in ticker.ScalarFormatter, use unicode to
- render multiplication sign in offset ticklabel - DSD
-
-2007-07-16 fixed a formatting bug in ticker.ScalarFormatter's scientific
- notation (10^0 was being rendered as 10 in some cases) - DSD
-
-2007-07-13 Add MPL_isfinite64() and MPL_isinf64() for testing
- doubles in (the now misnamed) MPL_isnan.h. - ADS
-
-2007-07-13 The matplotlib._isnan module removed (use numpy.isnan) - ADS
-
-2007-07-13 Some minor cleanups in _transforms.cpp - ADS
-
-2007-07-13 Removed the rest of the numerix extension code detritus,
- numpified axes.py, and cleaned up the imports in axes.py
- - JDH
-
-2007-07-13 Added legend.loc as configurable option that could in
- future default to 'best'. - NN
-
-2007-07-12 Bugfixes in mlab.py to coerce inputs into numpy arrays. -ADS
-
-2007-07-11 Added linespacing kwarg to text.Text - EF
-
-2007-07-11 Added code to store font paths in SVG files. - MGD
-
-2007-07-10 Store subset of TTF font as a Type 3 font in PDF files. - MGD
-
-2007-07-09 Store subset of TTF font as a Type 3 font in PS files. - MGD
-
-2007-07-09 Applied Paul's pick restructure pick and add pickers,
- sourceforge patch 1749829 - JDH
-
-
-2007-07-09 Applied Allan's draw_lines agg optimization. JDH
-
-
-2007-07-08 Applied Carl Worth's patch to fix cairo draw_arc - SC
-
-2007-07-07 fixed bug 1712099: xpdf distiller on windows - DSD
-
-2007-06-30 Applied patches to tkagg, gtk, and wx backends to reduce
- memory leakage. Patches supplied by Mike Droettboom;
- see tracker numbers 1745400, 1745406, 1745408.
- Also made unit/memleak_gui.py more flexible with
- command-line options. - EF
-
-2007-06-30 Split defaultParams into separate file rcdefaults (together with
- validation code). Some heavy refactoring was necessary to do so,
- but the overall behavior should be the same as before. - NN
-
-2007-06-27 Added MPLCONFIGDIR for the default location for mpl data
- and configuration. useful for some apache installs where
- HOME is not writable. Tried to clean up the logic in
- _get_config_dir to support non-writable HOME where are
- writable HOME/.matplotlib already exists - JDH
-
-2007-06-27 Fixed locale bug reported at
- http://sourceforge.net/tracker/index.php?func=detail&aid=1744154&group_id=80706&atid=560720
- by adding a cbook.unicode_safe function - JDH
-
-2007-06-27 Applied Micheal's tk savefig bugfix described at
- http://sourceforge.net/tracker/index.php?func=detail&aid=1716732&group_id=80706&atid=560720
- Thanks Michael!
-
-
-2007-06-27 Patch for get_py2exe_datafiles() to work with new directory
- layout. (Thanks Tocer and also Werner Bruhin.) -ADS
-
-
-2007-06-27 Added a scroll event to the mpl event handling system and
- implemented it for backends GTK* -- other backend
- users/developers/maintainers, please add support for your
- backend. - JDH
-
-2007-06-25 Changed default to clip=False in colors.Normalize;
- modified ColorbarBase for easier colormap display - EF
-
-2007-06-13 Added maskedarray option to rc, numerix - EF
-
-2007-06-11 Python 2.5 compatibility fix for mlab.py - EF
-
-2007-06-10 In matplotlibrc file, use 'dashed' | 'solid' instead
- of a pair of floats for contour.negative_linestyle - EF
-
-2007-06-08 Allow plot and fill fmt string to be any mpl string
- colorspec - EF
-
-2007-06-08 Added gnuplot file plotfile function to pylab -- see
- examples/plotfile_demo.py - JDH
-
-2007-06-07 Disable build of numarray and Numeric extensions for
- internal MPL use and the numerix layer. - ADS
-
-2007-06-07 Added csv2rec to matplotlib.mlab to support automatically
- converting csv files to record arrays using type
- introspection, and turned on native datetime support using
- the new units support in matplotlib.dates. See
- examples/loadrec.py ! JDH
-
-2007-06-07 Simplified internal code of _auto_legend_data - NN
-
-2007-06-04 Added labeldistance arg to Axes.pie to control the raidal
- distance of the wedge labels - JDH
-
-2007-06-03 Turned mathtext in SVG into single <text> with multiple <tspan>
- objects (easier to edit in inkscape). - NN
-
-===============================================================
-2007-06-02 Released 0.90.1 at revision 3352
-
-2007-06-02 Display only meaningful labels when calling legend()
- without args. - NN
-
-2007-06-02 Have errorbar follow the color cycle even if line is not plotted.
- Suppress plotting of errorbar caps for capsize=0. - NN
-
-2007-06-02 Set markers to same alpha value as line. - NN
-
-2007-06-02 Fix mathtext position in svg backend. - NN
-
-2007-06-01 Deprecate Numeric and numarray for use as numerix. Props to
- Travis -- job well done. - ADS
-
-2007-05-18 Added LaTeX unicode support. Enable with the
- 'text.latex.unicode' rcParam. This requires the ucs and
- inputenc LaTeX packages. - ADS
-
-2007-04-23 Fixed some problems with polar -- added general polygon
- clipping to clip the lines a nd grids to the polar axes.
- Added support for set_rmax to easily change the maximum
- radial grid. Added support for polar legend - JDH
-
-2007-04-16 Added Figure.autofmt_xdate to handle adjusting the bottom
- and rotating the tick labels for date plots when the ticks
- often overlap - JDH
-
-2007-04-09 Beginnings of usetex support for pdf backend. -JKS
-
-2007-04-07 Fixed legend/LineCollection bug. Added label support
- to collections. - EF
-
-2007-04-06 Removed deprecated support for a float value as a gray-scale;
- now it must be a string, like '0.5'. Added alpha kwarg to
- ColorConverter.to_rgba_list. - EF
-
-2007-04-06 Fixed rotation of ellipses in pdf backend
- (sf bug #1690559) -JKS
-
-2007-04-04 More matshow tweaks; documentation updates; new method
- set_bounds() for formatters and locators. - EF
-
-2007-04-02 Fixed problem with imshow and matshow of integer arrays;
- fixed problems with changes to color autoscaling. - EF
-
-2007-04-01 Made image color autoscaling work correctly with
- a tracking colorbar; norm.autoscale now scales
- unconditionally, while norm.autoscale_None changes
- only None-valued vmin, vmax. - EF
-
-2007-03-31 Added a qt-based subplot-adjustment dialog - DSD
-
-2007-03-30 Fixed a bug in backend_qt4, reported on mpl-dev - DSD
-
-2007-03-26 Removed colorbar_classic from figure.py; fixed bug in
- Figure.clf() in which _axobservers was not getting
- cleared. Modernization and cleanups. - EF
-
-2007-03-26 Refactored some of the units support -- units now live in
- the respective x and y Axis instances. See also
- API_CHANGES for some alterations to the conversion
- interface. JDH
-
-2007-03-25 Fix masked array handling in quiver.py for numpy. (Numeric
- and numarray support for masked arrays is broken in other
- ways when using quiver. I didn't pursue that.) - ADS
-
-2007-03-23 Made font_manager.py close opened files. - JKS
-
-2007-03-22 Made imshow default extent match matshow - EF
-
-2007-03-22 Some more niceties for xcorr -- a maxlags option, normed
- now works for xcorr as well as axorr, usevlines is
- supported, and a zero correlation hline is added. See
- examples/xcorr_demo.py. Thanks Sameer for the patch. -
- JDH
-
-2007-03-21 Axes.vlines and Axes.hlines now create and returns a
- LineCollection, not a list of lines. This is much faster.
- The kwarg signature has changed, so consult the docs.
- Modified Axes.errorbar which uses vlines and hlines. See
- API_CHANGES; the return signature for these three functions
- is now different
-
-2007-03-20 Refactored units support and added new examples - JDH
-
-2007-03-19 Added Mike's units patch - JDH
-
-2007-03-18 Matshow as an Axes method; test version matshow1() in
- pylab; added 'integer' Boolean kwarg to MaxNLocator
- initializer to force ticks at integer locations. - EF
-
-2007-03-17 Preliminary support for clipping to paths agg - JDH
-
-2007-03-17 Text.set_text() accepts anything convertible with '%s' - EF
-
-2007-03-14 Add masked-array support to hist. - EF
-
-2007-03-03 Change barh to take a kwargs dict and pass it to bar.
- Fixes sf bug #1669506.
-
-2007-03-02 Add rc parameter pdf.inheritcolor, which disables all
- color-setting operations in the pdf backend. The idea is
- that you include the resulting file in another program and
- set the colors (both stroke and fill color) there, so you
- can use the same pdf file for e.g. a paper and a
- presentation and have them in the surrounding color. You
- will probably not want to draw figure and axis frames in
- that case, since they would be filled in the same color. - JKS
-
-2007-02-26 Prevent building _wxagg.so with broken Mac OS X wxPython. - ADS
-
-2007-02-23 Require setuptools for Python 2.3 - ADS
-
-2007-02-22 WXAgg accelerator updates - KM
- WXAgg's C++ accelerator has been fixed to use the correct wxBitmap
- constructor.
-
- The backend has been updated to use new wxPython functionality to
- provide fast blit() animation without the C++ accelerator. This
- requires wxPython 2.8 or later. Previous versions of wxPython can
- use the C++ acclerator or the old pure Python routines.
-
- setup.py no longer builds the C++ accelerator when wxPython >= 2.8
- is present.
-
- The blit() method is now faster regardless of which agg/wxPython
- conversion routines are used.
-
-2007-02-21 Applied the PDF backend patch by Nicolas Grilly.
- This impacts several files and directories in matplotlib:
-
- - Created the directory lib/matplotlib/mpl-data/fonts/pdfcorefonts,
- holding AFM files for the 14 PDF core fonts. These fonts are
- embedded in every PDF viewing application.
-
- - setup.py: Added the directory pdfcorefonts to package_data.
-
- - lib/matplotlib/__init__.py: Added the default parameter
- 'pdf.use14corefonts'. When True, the PDF backend uses
- only the 14 PDF core fonts.
-
- - lib/matplotlib/afm.py: Added some keywords found in
- recent AFM files. Added a little workaround to handle
- Euro symbol.
-
- - lib/matplotlib/fontmanager.py: Added support for the 14
- PDF core fonts. These fonts have a dedicated cache (file
- pdfcorefont.cache), not the same as for other AFM files
- (file .afmfont.cache). Also cleaned comments to conform
- to CODING_GUIDE.
-
- - lib/matplotlib/backends/backend_pdf.py:
- Added support for 14 PDF core fonts.
- Fixed some issues with incorrect character widths and
- encodings (works only for the most common encoding,
- WinAnsiEncoding, defined by the official PDF Reference).
- Removed parameter 'dpi' because it causes alignment issues.
-
- -JKS (patch by Nicolas Grilly)
-
-2007-02-17 Changed ft2font.get_charmap, and updated all the files where
- get_charmap is mentioned - ES
-
-2007-02-13 Added barcode demo- JDH
-
-2007-02-13 Added binary colormap to cm - JDH
-
-2007-02-13 Added twiny to pylab - JDH
-
-2007-02-12 Moved data files into lib/matplotlib so that setuptools'
- develop mode works. Re-organized the mpl-data layout so
- that this source structure is maintained in the
- installation. (I.e. the 'fonts' and 'images'
- sub-directories are maintained in site-packages.) Suggest
- removing site-packages/matplotlib/mpl-data and
- ~/.matplotlib/ttffont.cache before installing - ADS
-
-2007-02-07 Committed Rob Hetland's patch for qt4: remove
- references to text()/latin1(), plus some improvements
- to the toolbar layout - DSD
-
-===============================================================
-2007-02-06 Released 0.90.0 at revision 3003
-
-2007-01-22 Extended the new picker API to text, patches and patch
- collections. Added support for user customizable pick hit
- testing and attribute tagging of the PickEvent - Details
- and examples in examples/pick_event_demo.py - JDH
-
-2007-01-16 Begun work on a new pick API using the mpl event handling
- frameowrk. Artists will define their own pick method with
- a configurable epsilon tolerance and return pick attrs.
- All artists that meet the tolerance threshold will fire a
- PickEvent with artist dependent attrs; eg, a Line2D can set
- the indices attribute that shows the indices into the line
- that are within epsilon of the pick point. See
- examples/pick_event_demo.py. The implementation of pick
- for the remaining Artists remains to be done, but the core
- infrastructure at the level of event handling is in place
- with a proof-of-concept implementation for Line2D - JDH
-
-2007-01-16 src/_image.cpp: update to use Py_ssize_t (for 64-bit systems).
- Use return value of fread() to prevent warning messages - SC.
-
-2007-01-15 src/_image.cpp: combine buffer_argb32() and buffer_bgra32() into
- a new method color_conv(format) - SC
-
-2007-01-14 backend_cairo.py: update draw_arc() so that
- examples/arctest.py looks correct - SC
-
-2007-01-12 backend_cairo.py: enable clipping. Update draw_image() so that
- examples/contour_demo.py looks correct - SC
-
-2007-01-12 backend_cairo.py: fix draw_image() so that examples/image_demo.py
- now looks correct - SC
-
-2007-01-11 Added Axes.xcorr and Axes.acorr to plot the cross
- correlation of x vs y or the autocorrelation of x. pylab
- wrappers also provided. See examples/xcorr_demo.py - JDH
-
-2007-01-10 Added "Subplot.label_outer" method. It will set the
- visibility of the ticklabels so that yticklabels are only
- visible in the first column and xticklabels are only
- visible in the last row - JDH
-
-2007-01-02 Added additional kwarg documentation - JDH
-
-2006-12-28 Improved error message for nonpositive input to log
- transform; added log kwarg to bar, barh, and hist,
- and modified bar method to behave sensibly by default
- when the ordinate has a log scale. (This only works
- if the log scale is set before or by the call to bar,
- hence the utility of the log kwarg.) - EF
-
-2006-12-27 backend_cairo.py: update draw_image() and _draw_mathtext() to work
- with numpy - SC
-
-2006-12-20 Fixed xpdf dependency check, which was failing on windows.
- Removed ps2eps dependency check. - DSD
-
-2006-12-19 Added Tim Leslie's spectral patch - JDH
-
-2006-12-17 Added rc param 'axes.formatter.limits' to control
- ...
[truncated message content] |
|
From: <cm...@us...> - 2008-12-10 01:59:08
|
Revision: 6536
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6536&view=rev
Author: cmoad
Date: 2008-12-10 01:59:04 +0000 (Wed, 10 Dec 2008)
Log Message:
-----------
minor rev bump
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/__init__.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-09 12:27:51 UTC (rev 6535)
+++ trunk/matplotlib/CHANGELOG 2008-12-10 01:59:04 UTC (rev 6536)
@@ -1,3 +1,5 @@
+================================================================= 2008-12-09 Released 0.98.4 at svn r6536
+
2008-12-08 Added mdehoon's native macosx backend from sf patch 2179017 - JDH
2008-12-08 Removed the prints in the set_*style commands. Return the
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-09 12:27:51 UTC (rev 6535)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-12-10 01:59:04 UTC (rev 6536)
@@ -89,7 +89,7 @@
"""
from __future__ import generators
-__version__ = '0.98.3'
+__version__ = '0.98.4'
__revision__ = '$Revision$'
__date__ = '$Date$'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-09 12:27:55
|
Revision: 6535
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6535&view=rev
Author: jdh2358
Date: 2008-12-09 12:27:51 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
removed extraneous savefig calls from examples
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/api/barchart_demo.py
trunk/matplotlib/examples/api/histogram_demo.py
trunk/matplotlib/examples/api/logo2.py
trunk/matplotlib/examples/api/watermark_image.py
trunk/matplotlib/examples/api/watermark_text.py
trunk/matplotlib/examples/pylab_examples/agg_buffer_to_array.py
trunk/matplotlib/examples/pylab_examples/alignment_test.py
trunk/matplotlib/examples/pylab_examples/annotation_demo.py
trunk/matplotlib/examples/pylab_examples/annotation_demo2.py
trunk/matplotlib/examples/pylab_examples/arctest.py
trunk/matplotlib/examples/pylab_examples/arrow_demo.py
trunk/matplotlib/examples/pylab_examples/axes_demo.py
trunk/matplotlib/examples/pylab_examples/axes_props.py
trunk/matplotlib/examples/pylab_examples/barchart_demo.py
trunk/matplotlib/examples/pylab_examples/barcode_demo.py
trunk/matplotlib/examples/pylab_examples/boxplot_demo.py
trunk/matplotlib/examples/pylab_examples/broken_barh.py
trunk/matplotlib/examples/pylab_examples/contour_demo.py
trunk/matplotlib/examples/pylab_examples/contour_image.py
trunk/matplotlib/examples/pylab_examples/contourf_demo.py
trunk/matplotlib/examples/pylab_examples/custom_figure_class.py
trunk/matplotlib/examples/pylab_examples/customize_rc.py
trunk/matplotlib/examples/pylab_examples/dannys_example.py
trunk/matplotlib/examples/pylab_examples/dash_control.py
trunk/matplotlib/examples/pylab_examples/dashpointlabel.py
trunk/matplotlib/examples/pylab_examples/date_demo2.py
trunk/matplotlib/examples/pylab_examples/date_demo_rrule.py
trunk/matplotlib/examples/pylab_examples/ellipse_demo.py
trunk/matplotlib/examples/pylab_examples/equal_aspect_ratio.py
trunk/matplotlib/examples/pylab_examples/errorbar_demo.py
trunk/matplotlib/examples/pylab_examples/figimage_demo.py
trunk/matplotlib/examples/pylab_examples/figure_title.py
trunk/matplotlib/examples/pylab_examples/fonts_demo.py
trunk/matplotlib/examples/pylab_examples/fonts_demo_kw.py
trunk/matplotlib/examples/pylab_examples/hline_demo.py
trunk/matplotlib/examples/pylab_examples/image_demo2.py
trunk/matplotlib/examples/pylab_examples/image_demo3.py
trunk/matplotlib/examples/pylab_examples/image_interp.py
trunk/matplotlib/examples/pylab_examples/image_origin.py
trunk/matplotlib/examples/pylab_examples/integral_demo.py
trunk/matplotlib/examples/pylab_examples/layer_images.py
trunk/matplotlib/examples/pylab_examples/legend_demo.py
trunk/matplotlib/examples/pylab_examples/legend_demo2.py
trunk/matplotlib/examples/pylab_examples/legend_demo3.py
trunk/matplotlib/examples/pylab_examples/logo.py
trunk/matplotlib/examples/pylab_examples/manual_axis.py
trunk/matplotlib/examples/pylab_examples/mathtext_demo.py
trunk/matplotlib/examples/pylab_examples/matplotlib_icon.py
trunk/matplotlib/examples/pylab_examples/mri_demo.py
trunk/matplotlib/examples/pylab_examples/multiline.py
trunk/matplotlib/examples/pylab_examples/multiple_figs_demo.py
trunk/matplotlib/examples/pylab_examples/pcolor_demo.py
trunk/matplotlib/examples/pylab_examples/pcolor_demo2.py
trunk/matplotlib/examples/pylab_examples/pcolor_log.py
trunk/matplotlib/examples/pylab_examples/polar_legend.py
trunk/matplotlib/examples/pylab_examples/polar_scatter.py
trunk/matplotlib/examples/pylab_examples/poormans_contour.py
trunk/matplotlib/examples/pylab_examples/pstest.py
trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py
trunk/matplotlib/examples/pylab_examples/scatter_demo.py
trunk/matplotlib/examples/pylab_examples/scatter_profile.py
trunk/matplotlib/examples/pylab_examples/simple_plot_fps.py
trunk/matplotlib/examples/pylab_examples/stock_demo.py
trunk/matplotlib/examples/pylab_examples/symlog_demo.py
trunk/matplotlib/examples/pylab_examples/table_demo.py
trunk/matplotlib/examples/pylab_examples/tex_demo.py
trunk/matplotlib/examples/pylab_examples/tex_unicode_demo.py
trunk/matplotlib/examples/pylab_examples/text_themes.py
trunk/matplotlib/examples/pylab_examples/toggle_images.py
trunk/matplotlib/examples/pylab_examples/unicode_demo.py
trunk/matplotlib/examples/pylab_examples/webapp_demo.py
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/CHANGELOG 2008-12-09 12:27:51 UTC (rev 6535)
@@ -1,7 +1,7 @@
-2008-12-08 Added mdehoon's native macosx backend from sf patch 2179017
+2008-12-08 Added mdehoon's native macosx backend from sf patch 2179017 - JDH
2008-12-08 Removed the prints in the set_*style commands. Return the
- list of pprinted strings instead
+ list of pprinted strings instead - JDH
2008-12-08 Some of the changes Michael made to improve the output of
the property tables in the rest docs broke of made
Modified: trunk/matplotlib/examples/api/barchart_demo.py
===================================================================
--- trunk/matplotlib/examples/api/barchart_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/api/barchart_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -36,5 +36,5 @@
autolabel(rects1)
autolabel(rects2)
-#fig.savefig('barchart_demo')
+
plt.show()
Modified: trunk/matplotlib/examples/api/histogram_demo.py
===================================================================
--- trunk/matplotlib/examples/api/histogram_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/api/histogram_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -31,5 +31,4 @@
ax.set_ylim(0, 0.03)
ax.grid(True)
-#fig.savefig('histogram_demo',dpi=72)
plt.show()
Modified: trunk/matplotlib/examples/api/logo2.py
===================================================================
--- trunk/matplotlib/examples/api/logo2.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/api/logo2.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -67,10 +67,10 @@
for line in ax.get_ygridlines() + ax.get_xgridlines():
line.set_lw(0.8)
- line.set_alpha(0.9)
+ line.set_alpha(0.9)
line.set_ls('-')
line.set_color('0.5')
-
+
ax.set_yticks(np.arange(1, 9, 2))
ax.set_rmax(9)
@@ -78,7 +78,6 @@
main_axes = add_math_background()
add_polar_bar()
add_matplotlib_text(main_axes)
- fig.savefig('logo2.png', facecolor=figcolor, edgecolor=figcolor, dpi=dpi)
plt.show()
Modified: trunk/matplotlib/examples/api/watermark_image.py
===================================================================
--- trunk/matplotlib/examples/api/watermark_image.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/api/watermark_image.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -18,6 +18,4 @@
ax.grid()
fig.figimage(im, 10, 10)
-#fig.savefig('watermarked', transparent=True)
-
plt.show()
Modified: trunk/matplotlib/examples/api/watermark_text.py
===================================================================
--- trunk/matplotlib/examples/api/watermark_text.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/api/watermark_text.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -18,7 +18,4 @@
fontsize=50, color='gray',
ha='right', va='bottom', alpha=0.5)
-#fig.savefig('watermarked_text', transparent=True)
-
-
plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/agg_buffer_to_array.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/agg_buffer_to_array.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/agg_buffer_to_array.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -20,5 +20,4 @@
fig2 = figure()
ax2 = fig2.add_subplot(111, frameon=False)
ax2.imshow(X)
-fig2.savefig('simple.png')
show()
Modified: trunk/matplotlib/examples/pylab_examples/alignment_test.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/alignment_test.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/alignment_test.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -78,5 +78,5 @@
transform=ax.transAxes)
axis('off')
-#savefig('alignment_test', dpi=100)
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/annotation_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/annotation_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/annotation_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -82,7 +82,6 @@
horizontalalignment='right', verticalalignment='bottom',
fontsize=20)
- #fig.savefig('annotation_coords')
if 1:
# you can specify the xypoint and the xytext in different
@@ -111,8 +110,8 @@
horizontalalignment='left',
verticalalignment='bottom',
)
- #fig.savefig('annotation_polar')
+
if 1:
# You can also use polar notation on a catesian axes. Here the
# native coordinate system ('data') is cartesian, so you need to
@@ -138,9 +137,5 @@
ax.set_xlim(-20, 20)
ax.set_ylim(-20, 20)
- #fig.savefig('annotation_ellipse')
-
-
-#fig.savefig('annotation_demo.png')
show()
Modified: trunk/matplotlib/examples/pylab_examples/annotation_demo2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/annotation_demo2.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/annotation_demo2.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -72,9 +72,7 @@
- #fig.savefig('annotation_connection')
-
if 1:
fig = figure(2)
fig.clf()
@@ -146,6 +144,4 @@
)
)
- #fig.savefig('annotation_arrowstyle')
-
show()
Modified: trunk/matplotlib/examples/pylab_examples/arctest.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/arctest.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/arctest.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -13,6 +13,6 @@
l = plot(t1, f(t1), 'ro')
setp(l, 'markersize', 30)
setp(l, 'markerfacecolor', 'b')
-#savefig('arctest', dpi=150)
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/arrow_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/arrow_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/arrow_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -308,6 +308,5 @@
normalize_data=scaled, head_starts_at_zero=True, size=size)
draw()
- #savefig('arrows.png')
- #print 'Example saved to file "arrows.png"'
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/axes_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/axes_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/axes_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -28,6 +28,5 @@
title('Impulse response')
setp(a, xlim=(0,.2), xticks=[], yticks=[])
-#savefig('../figures/axes_demo.eps')
-#savefig('../figures/axes_demo.png')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/axes_props.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/axes_props.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/axes_props.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -26,7 +26,7 @@
setp(xticklabels, 'color', 'r', fontsize='medium')
-#savefig('axprops_demo')
+
show()
@@ -57,7 +57,6 @@
label.set_color('r')
label.set_fontsize('medium')
-#savefig('axprops_demo')
show()
"""
Modified: trunk/matplotlib/examples/pylab_examples/barchart_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/barchart_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/barchart_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -34,5 +34,5 @@
autolabel(rects1)
autolabel(rects2)
-#savefig('barchart_demo')
+
plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/barcode_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/barcode_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/barcode_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -21,6 +21,6 @@
ax = fig.add_axes([0.3, 0.1, 0.6, 0.1], **axprops)
ax.imshow(x, **barprops)
-#fig.savefig('barcode.png', dpi=100)
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/boxplot_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/boxplot_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/boxplot_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -15,32 +15,26 @@
# basic plot
boxplot(data)
-#savefig('box1')
# notched plot
figure()
boxplot(data,1)
-#savefig('box2')
# change outlier point symbols
figure()
boxplot(data,0,'gD')
-#savefig('box3')
# don't show outlier points
figure()
boxplot(data,0,'')
-#savefig('box4')
# horizontal boxes
figure()
boxplot(data,0,'rs',0)
-#savefig('box5')
# change whisker length
figure()
boxplot(data,0,'rs',0,0.75)
-#savefig('box6')
# fake up some more data
spread= rand(50) * 100
@@ -59,7 +53,6 @@
# multiple box plots on one figure
figure()
boxplot(data)
-#savefig('box7')
show()
Modified: trunk/matplotlib/examples/pylab_examples/broken_barh.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/broken_barh.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/broken_barh.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -20,5 +20,4 @@
fontsize=16,
horizontalalignment='right', verticalalignment='top')
-#fig.savefig('broken_barh', dpi=100)
plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/contour_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/contour_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/contour_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -101,5 +101,4 @@
CB.ax.set_position([ll, b+0.1*h, ww, h*0.8])
-#savefig('contour_demo')
plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/contour_image.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/contour_image.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/contour_image.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -98,6 +98,5 @@
setp(gca(), ylim=ylim[::-1])
title("Image, origin from rc, reversed y-axis")
colorbar(im)
-#savefig('contour_image')
show()
Modified: trunk/matplotlib/examples/pylab_examples/contourf_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/contourf_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/contourf_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -76,6 +76,5 @@
clabel(CS4, fmt = '%2.1f', colors = 'w', fontsize=14)
colorbar(CS3)
-#savefig('contourf_demo')
show()
Modified: trunk/matplotlib/examples/pylab_examples/custom_figure_class.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/custom_figure_class.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/custom_figure_class.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -16,7 +16,6 @@
fig = figure(FigureClass=MyFigure, figtitle='my title')
ax = fig.add_subplot(111)
ax.plot([1,2,3])
-fig.savefig('test.png')
-fig.savefig('test.ps')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/customize_rc.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/customize_rc.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/customize_rc.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+
"""
I'm not trying to make a good liking figure here, but just to show
some examples of customizing rc params on the fly
@@ -13,7 +13,7 @@
rc('tick', labelsize=15) # tick labels bigger
rc('lines', lw=1, color='k') # thicker black lines (no budget for color!)
rc('grid', c='0.5', ls='-', lw=0.5) # solid gray grid lines
- rc('#savefig', dpi=300) # higher res outputs
+ rc('savefig', dpi=300) # higher res outputs
@@ -22,7 +22,7 @@
>>> set_pub()
>>> subplot(111)
>>> plot([1,2,3])
->>> #savefig('myfig')
+>>> savefig('myfig')
>>> rcdefaults() # restore the defaults
"""
Modified: trunk/matplotlib/examples/pylab_examples/dannys_example.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/dannys_example.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/dannys_example.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -56,5 +56,4 @@
pylab.text(0.2, 0.15, r'$\mathcal{F} = \int f\left( \phi, c \right) dV,$ \newline $ \frac{ \partial \phi } { \partial t } = -M_{ \phi } \frac{ \delta \mathcal{F} } { \delta \phi }$',
{'color' : 'b', 'fontsize' : 20})
-pylab.savefig('pfm-lsm.png')
pylab.show()
Modified: trunk/matplotlib/examples/pylab_examples/dash_control.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/dash_control.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/dash_control.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -10,5 +10,5 @@
l, = plot(arange(20), '--')
l.set_dashes(dashes)
-savefig('dash_control')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/dashpointlabel.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/dashpointlabel.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/dashpointlabel.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -35,7 +35,6 @@
ax.set_xlim((0.0, 5.0))
ax.set_ylim((0.0, 5.0))
-#if save:
-# pylab.savefig('dashpointlabel')
+
pylab.show()
Modified: trunk/matplotlib/examples/pylab_examples/date_demo2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/date_demo2.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/date_demo2.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -43,5 +43,4 @@
fig.autofmt_xdate()
-#fig.savefig('date_demo2')
show()
Modified: trunk/matplotlib/examples/pylab_examples/date_demo_rrule.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/date_demo_rrule.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/date_demo_rrule.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -28,5 +28,4 @@
labels = ax.get_xticklabels()
setp(labels, rotation=30, fontsize=10)
-savefig('date_demo_rrule')
show()
Modified: trunk/matplotlib/examples/pylab_examples/ellipse_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/ellipse_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/ellipse_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -17,7 +17,4 @@
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
-#fig.savefig('ellipse_demo.eps')
-#fig.savefig('ellipse_demo.png')
-
show()
Modified: trunk/matplotlib/examples/pylab_examples/equal_aspect_ratio.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/equal_aspect_ratio.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/equal_aspect_ratio.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -17,7 +17,4 @@
axes().set_aspect('equal', 'datalim')
-#savefig('simple_plot.png')
-savefig('equal_aspect')
-
show()
Modified: trunk/matplotlib/examples/pylab_examples/errorbar_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/errorbar_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/errorbar_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -43,5 +43,4 @@
ax.set_yscale('log')
errorbar(t, s+2, e, f, fmt='o') # both symmetric
-#savefig('errorbar_demo')
show()
Modified: trunk/matplotlib/examples/pylab_examples/figimage_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/figimage_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/figimage_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -15,9 +15,6 @@
im1 = plt.figimage(Z, xo=50, yo=0, cmap=cm.jet, origin='lower')
im2 = plt.figimage(Z, xo=100, yo=100, alpha=.8, cmap=cm.jet, origin='lower')
-#fig.savefig('figimage_demo.png')
-#fig.savefig('figimage_demo.svg')
-#fig.savefig('figimage_demo.pdf')
plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/figure_title.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/figure_title.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/figure_title.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -25,6 +25,5 @@
title('subplot 2')
ylabel('Undamped')
-#savefig('figtext')
show()
Modified: trunk/matplotlib/examples/pylab_examples/fonts_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/fonts_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/fonts_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -111,5 +111,5 @@
**alignment)
axis([-1,1,0,1])
-#savefig('fonts_demo')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/fonts_demo_kw.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/fonts_demo_kw.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/fonts_demo_kw.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -80,5 +80,5 @@
**alignment)
axis([-1, 1, 0, 1])
-#savefig('fonts_demo_kw')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/hline_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/hline_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/hline_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -17,7 +17,7 @@
plt.hlines(t, [0], s, lw=2)
plt.xlabel('time (s)')
plt.title('Comparison of model with data')
-plt.savefig('test')
+
plt.xlim(xmin=0)
plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/image_demo2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/image_demo2.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/image_demo2.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -28,6 +28,5 @@
ylabel('density')
setp(gca(), 'xticklabels', [])
-#savefig('image_demo2')
show()
Modified: trunk/matplotlib/examples/pylab_examples/image_demo3.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/image_demo3.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/image_demo3.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -14,6 +14,5 @@
ax.set_axis_off()
im = imshow(lena, origin='lower')
-#savefig('image_demo3')
show()
Modified: trunk/matplotlib/examples/pylab_examples/image_interp.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/image_interp.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/image_interp.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -50,17 +50,14 @@
A = rand(5,5)
figure(1)
imshow(A, interpolation='nearest')
-savefig('agg_nearest')
grid(True)
figure(2)
imshow(A, interpolation='bilinear')
-savefig('agg_bilinear')
grid(True)
figure(3)
imshow(A, interpolation='bicubic')
-savefig('agg_bicubic')
grid(True)
show()
Modified: trunk/matplotlib/examples/pylab_examples/image_origin.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/image_origin.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/image_origin.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -21,5 +21,4 @@
title('blue should be down')
imshow(x, origin='lower', interpolation=interp)
#axis(lim)
-savefig('image_origin')
show()
Modified: trunk/matplotlib/examples/pylab_examples/integral_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/integral_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/integral_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -31,5 +31,4 @@
ax.set_xticks((a,b))
ax.set_xticklabels(('a','b'))
ax.set_yticks([])
-#savefig('integral_demo')
show()
Modified: trunk/matplotlib/examples/pylab_examples/layer_images.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/layer_images.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/layer_images.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -38,11 +38,6 @@
extent=extent)
#axis([xmin, xmax, ymin, ymax])
-
-savefig('layer_images.png')
-savefig('layer_images.svg')
-savefig('layer_images.pdf')
-
show()
Modified: trunk/matplotlib/examples/pylab_examples/legend_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/legend_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -39,7 +39,6 @@
plt.setp(ltext, fontsize='small') # the legend text fontsize
plt.setp(llines, linewidth=1.5) # the legend linewidth
#leg.draw_frame(False) # don't draw the legend frame
-#plt.savefig('legend_demo')
plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/legend_demo2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_demo2.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/legend_demo2.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -17,7 +17,6 @@
xlabel('time')
ylabel('volts')
title('Damped oscillation')
-#savefig('legend_demo2')
#axis([0,2,-1,1])
show()
Modified: trunk/matplotlib/examples/pylab_examples/legend_demo3.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_demo3.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/legend_demo3.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -31,6 +31,5 @@
plt.draw()
plt.show()
-#plt.savefig("legend_demo3")
Modified: trunk/matplotlib/examples/pylab_examples/logo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/logo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/logo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -20,5 +20,5 @@
axis([1, 1.72,-60, 10])
setp(gca(), 'xticklabels', [])
setp(gca(), 'yticklabels', [])
-#savefig('logo2.png', dpi=300)
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/manual_axis.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/manual_axis.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/manual_axis.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -52,6 +52,6 @@
ax.set_ylim(-1.5, 1.5)
make_xaxis(ax, 0, offset=0.1, **props)
make_yaxis(ax, 0, offset=5, **props)
-#fig.savefig('manual_axis.png', dpi=100, facecolor='white', edgecolor='white')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/mathtext_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/mathtext_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/mathtext_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -23,7 +23,7 @@
ax.legend([r"$\sqrt{x^2}$"])
ax.set_title(r'$\Delta_i^j \hspace{0.4} \mathrm{versus} \hspace{0.4} \Delta_{i+1}^j$', fontsize=20)
-fig.savefig('mathtext_demo')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/matplotlib_icon.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/matplotlib_icon.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/matplotlib_icon.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -17,5 +17,5 @@
# grid(True)
setp(gca(), xticklabels=[], yticklabels=[])
-savefig('matplotlib.svg', facecolor='0.75')
+savefig('matplotlib', facecolor='0.75')
Modified: trunk/matplotlib/examples/pylab_examples/mri_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/mri_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/mri_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -9,5 +9,5 @@
#imshow(im, ColormapJet(256))
imshow(im, cmap=cm.jet)
axis('off')
-#savefig('mri_demo')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/multiline.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/multiline.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/multiline.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -10,6 +10,6 @@
horizontalalignment = 'center',
verticalalignment = 'top',
multialignment = 'center')
-#savefig('multiline')
+
grid(True)
show()
Modified: trunk/matplotlib/examples/pylab_examples/multiple_figs_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/multiple_figs_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/multiple_figs_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -21,9 +21,9 @@
plot(t,s2, 'gs')
setp(gca(), 'xticklabels', [])
-#figure(1)
-#savefig('fig1')
-#figure(2)
-#savefig('fig2')
+figure(1)
+savefig('fig1')
+figure(2)
+savefig('fig2')
show()
Modified: trunk/matplotlib/examples/pylab_examples/pcolor_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/pcolor_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/pcolor_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -22,7 +22,7 @@
pcolor(X, Y, Z)
colorbar()
axis([-3,3,-3,3])
-savefig('pcolor_demo')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/pcolor_demo2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/pcolor_demo2.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/pcolor_demo2.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -25,7 +25,7 @@
#im.set_interpolation('bicubic')
im.set_interpolation('bilinear')
#ax.set_image_extent(-3, 3, -3, 3)
-#savefig('pcolor_demo2')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/pcolor_log.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/pcolor_log.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/pcolor_log.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -24,4 +24,4 @@
show()
-#savefig('pcolor_log.png')
+
Modified: trunk/matplotlib/examples/pylab_examples/polar_legend.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/polar_legend.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/polar_legend.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -17,5 +17,5 @@
ax.plot(theta, r, color='#ee8d18', lw=3, label='a line')
ax.plot(0.5*theta, r, color='blue', ls='--', lw=3, label='another line')
ax.legend()
-fig.savefig('polar_legend')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/polar_scatter.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/polar_scatter.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/polar_scatter.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -14,5 +14,5 @@
c = scatter(theta, r, c=colors, s=area)
c.set_alpha(0.75)
-#savefig('polar_test2')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/poormans_contour.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/poormans_contour.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/poormans_contour.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -23,6 +23,6 @@
im = imshow(Z, cmap=cmap, interpolation='bilinear')
axis('off')
colorbar()
-#savefig('test')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/pstest.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/pstest.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/pstest.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -25,6 +25,6 @@
ylabel('Signal 2', fontsize=12)
xlabel('time (s)', fontsize=12)
-#savefig('pstest')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -42,5 +42,4 @@
ax.set_title('With masked values')
-savefig("quadmesh_demo")
show()
Modified: trunk/matplotlib/examples/pylab_examples/scatter_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/scatter_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/scatter_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -6,6 +6,5 @@
y = 0.9*rand(N)
area = pi*(10 * rand(N))**2 # 0 to 10 point radiuses
scatter(x,y,s=area, marker='^', c='r')
-savefig('test.ps')
-savefig('test.pdf')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/scatter_profile.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/scatter_profile.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/scatter_profile.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -19,5 +19,4 @@
y = 0.9*rand(N)
s = 20*rand(N)
scatter(x,y,s)
- #savefig('scatter_demo')
print '%d symbols in %1.2f s' % (N, time.time()-tstart)
Modified: trunk/matplotlib/examples/pylab_examples/simple_plot_fps.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/simple_plot_fps.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/simple_plot_fps.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -17,9 +17,6 @@
title('About as simple as it gets, folks')
grid(True)
-#savefig('simple_plot.png')
-#savefig('simple_plot')
-
import time
frames = 100.0
Modified: trunk/matplotlib/examples/pylab_examples/stock_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/stock_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/stock_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -15,5 +15,5 @@
title('INTC vs AAPL')
legend( ('INTC', 'AAPL') )
-#savefig('stock_demo')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/symlog_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/symlog_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/symlog_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -25,5 +25,4 @@
grid(True)
ylabel('symlog both')
-savefig('symlog_demo')
show()
Modified: trunk/matplotlib/examples/pylab_examples/table_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/table_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/table_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -88,7 +88,5 @@
yticks(vals*1000, ['%d' % val for val in vals])
xticks([])
title('Loss by Disaster')
-#savefig('table_demo_small', dpi=75)
-#savefig('table_demo_large', dpi=300)
show()
Modified: trunk/matplotlib/examples/pylab_examples/tex_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/tex_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/tex_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -29,7 +29,5 @@
title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
fontsize=16, color='r')
grid(True)
-savefig('tex_demo')
-
show()
Modified: trunk/matplotlib/examples/pylab_examples/tex_unicode_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/tex_unicode_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/tex_unicode_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -22,7 +22,4 @@
title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
fontsize=16, color='r')
grid(True)
-savefig('tex_demo')
-
-
show()
Modified: trunk/matplotlib/examples/pylab_examples/text_themes.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/text_themes.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/text_themes.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -21,5 +21,4 @@
xlabel('time (s)', font, style='italic')
ylabel('voltage (mV)', font)
-#savefig('text_themes')
show()
Modified: trunk/matplotlib/examples/pylab_examples/toggle_images.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/toggle_images.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/toggle_images.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -40,5 +40,5 @@
draw()
connect('key_press_event', toggle_images)
-#savefig('toggle_images')
+
show()
Modified: trunk/matplotlib/examples/pylab_examples/unicode_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/unicode_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/unicode_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -9,5 +9,4 @@
text( 0.5, 2.5, u'Institut für Festkörperphysik', rotation=45)
text( 1, 1.5, u'AVA (check kerning)')
-savefig('test')
show()
Modified: trunk/matplotlib/examples/pylab_examples/webapp_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/webapp_demo.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/pylab_examples/webapp_demo.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -61,6 +61,6 @@
l.set_fontsize(12)
canvas = FigureCanvasAgg(fig)
- canvas.print_figure('webapp.png', dpi=150)
+ canvas.print_figure('webapp', dpi=150)
make_fig()
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-12-09 10:23:53 UTC (rev 6534)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-12-09 12:27:51 UTC (rev 6535)
@@ -123,7 +123,6 @@
'legend_demo.py',
'legend_demo2.py',
'legend_demo3.py',
- 'legend_demo3.py',
'legend_scatter.py',
'line_collection.py',
'line_collection2.py',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-12-09 10:23:57
|
Revision: 6534
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6534&view=rev
Author: mmetz_bn
Date: 2008-12-09 10:23:53 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
typo in subplot docs
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-09 04:39:50 UTC (rev 6533)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-09 10:23:53 UTC (rev 6534)
@@ -7163,7 +7163,7 @@
*args* is the tuple (*numRows*, *numCols*, *plotNum*), where
the array of subplots in the figure has dimensions *numRows*,
*numCols*, and where *plotNum* is the number of the subplot
- being created. *plotNum* starts at 1 in the upper right
+ being created. *plotNum* starts at 1 in the upper left
corner and increases to the right.
If *numRows* <= *numCols* <= *plotNum* < 10, *args* can be the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-09 04:39:52
|
Revision: 6533
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6533&view=rev
Author: jdh2358
Date: 2008-12-09 04:39:50 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
fixed links in artist tut
Modified Paths:
--------------
trunk/matplotlib/doc/api/artist_api.rst
trunk/matplotlib/doc/users/artists.rst
trunk/matplotlib/doc/users/installing.rst
Modified: trunk/matplotlib/doc/api/artist_api.rst
===================================================================
--- trunk/matplotlib/doc/api/artist_api.rst 2008-12-09 04:12:34 UTC (rev 6532)
+++ trunk/matplotlib/doc/api/artist_api.rst 2008-12-09 04:39:50 UTC (rev 6533)
@@ -1,3 +1,5 @@
+.. _artist-api:
+
*******************
matplotlib artists
*******************
Modified: trunk/matplotlib/doc/users/artists.rst
===================================================================
--- trunk/matplotlib/doc/users/artists.rst 2008-12-09 04:12:34 UTC (rev 6532)
+++ trunk/matplotlib/doc/users/artists.rst 2008-12-09 04:39:50 UTC (rev 6533)
@@ -230,10 +230,8 @@
.. TODO: Update these URLs
The docstrings for all of the classes also contain the ``Artist``
-properties, so you can consult the interactive "help", the online html
-docs at http://matplotlib.sourceforge.net/classdocs.html or PDF documentation
-at http://matplotlib.sourceforge.net/api.pdf for a listing of
-properties for a give object.
+properties, so you can consult the interactive "help" or the
+:ref:`artist-api` for a listing of properties for a given object.
.. _object-containers:
Modified: trunk/matplotlib/doc/users/installing.rst
===================================================================
--- trunk/matplotlib/doc/users/installing.rst 2008-12-09 04:12:34 UTC (rev 6532)
+++ trunk/matplotlib/doc/users/installing.rst 2008-12-09 04:39:50 UTC (rev 6533)
@@ -98,7 +98,7 @@
python setup.py install
We provide a `setup.cfg
-<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/setup.cfg.template?view=markup>`
+<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/setup.cfg.template?view=markup>`_
file that lives along :file:`setup.py` which you can use to customize
the build process, for example, which default backend to use, whether
some of the optional libraries that matplotlib ships with are
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-09 04:12:37
|
Revision: 6532
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6532&view=rev
Author: ryanmay
Date: 2008-12-09 04:12:34 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
Fix typo in docstring.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-09 03:51:35 UTC (rev 6531)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-09 04:12:34 UTC (rev 6532)
@@ -5548,7 +5548,7 @@
fill_between(x, y1, y2=0, where=None, **kwargs)
- Create a :class:`~matplotlib.collectionsPolyCollection`
+ Create a :class:`~matplotlib.collections.PolyCollection`
filling the regions between *y1* and *y2* where
``where==True``
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-09 03:51:40
|
Revision: 6531
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6531&view=rev
Author: jdh2358
Date: 2008-12-09 03:51:35 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
added mdehoon's native macosx patch
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Added Paths:
-----------
trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py
trunk/matplotlib/src/_macosx.m
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-09 03:49:11 UTC (rev 6530)
+++ trunk/matplotlib/CHANGELOG 2008-12-09 03:51:35 UTC (rev 6531)
@@ -1,4 +1,4 @@
-2008-12-08 Added mdehoon's native maxosx backend from sf patch 2179017
+2008-12-08 Added mdehoon's native macosx backend from sf patch 2179017
2008-12-08 Removed the prints in the set_*style commands. Return the
list of pprinted strings instead
Added: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py (rev 0)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2008-12-09 03:51:35 UTC (rev 6531)
@@ -0,0 +1,415 @@
+from __future__ import division
+
+import os
+import numpy
+
+from matplotlib._pylab_helpers import Gcf
+from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
+ FigureManagerBase, FigureCanvasBase, NavigationToolbar2
+from matplotlib.cbook import maxdict
+from matplotlib.figure import Figure
+from matplotlib.path import Path
+from matplotlib.mathtext import MathTextParser
+
+
+
+from matplotlib.widgets import SubplotTool
+
+import matplotlib
+from matplotlib.backends import _macosx
+
+def show():
+ """Show all the figures and enter the Cocoa mainloop.
+ This function will not return until all windows are closed or
+ the interpreter exits."""
+ # Having a Python-level function "show" wrapping the built-in
+ # function "show" in the _macosx extension module allows us to
+ # to add attributes to "show". This is something ipython does.
+ _macosx.show()
+
+class RendererMac(RendererBase):
+ """
+ The renderer handles drawing/rendering operations. Most of the renderer's
+ methods forwards the command to the renderer's graphics context. The
+ renderer does not wrap a C object and is written in pure Python.
+ """
+
+ texd = maxdict(50) # a cache of tex image rasters
+
+ def __init__(self, dpi, width, height):
+ RendererBase.__init__(self)
+ self.dpi = dpi
+ self.width = width
+ self.height = height
+ self.gc = GraphicsContextMac()
+ self.mathtext_parser = MathTextParser('MacOSX')
+
+ def set_width_height (self, width, height):
+ self.width, self.height = width, height
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ path = transform.transform_path(path)
+ for points, code in path.iter_segments():
+ if code == Path.MOVETO:
+ gc.moveto(points)
+ elif code == Path.LINETO:
+ gc.lineto(points)
+ elif code == Path.CURVE3:
+ gc.curve3(points)
+ elif code == Path.CURVE4:
+ gc.curve4(points)
+ elif code == Path.CLOSEPOLY:
+ gc.closepoly()
+ if rgbFace is not None:
+ rgbFace = tuple(rgbFace)
+ gc.stroke(rgbFace)
+
+ def new_gc(self):
+ self.gc.reset()
+ return self.gc
+
+ def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None):
+ self.gc.set_clip_rectangle(bbox)
+ im.flipud_out()
+ nrows, ncols, data = im.as_rgba_str()
+ self.gc.draw_image(x, y, nrows, ncols, data)
+ im.flipud_out()
+
+ def draw_tex(self, gc, x, y, s, prop, angle):
+ # todo, handle props, angle, origins
+ size = prop.get_size_in_points()
+ texmanager = self.get_texmanager()
+ key = s, size, self.dpi, angle, texmanager.get_font_config()
+ im = self.texd.get(key) # Not sure what this does; just copied from backend_agg.py
+ if im is None:
+ Z = texmanager.get_grey(s, size, self.dpi)
+ Z = numpy.array(255.0 - Z * 255.0, numpy.uint8)
+
+ gc.draw_mathtext(x, y, angle, Z)
+
+ def _draw_mathtext(self, gc, x, y, s, prop, angle):
+ size = prop.get_size_in_points()
+ ox, oy, width, height, descent, image, used_characters = \
+ self.mathtext_parser.parse(s, self.dpi, prop)
+ gc.draw_mathtext(x, y, angle, 255 - image.as_array())
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False):
+ if ismath:
+ self._draw_mathtext(gc, x, y, s, prop, angle)
+ else:
+ family = prop.get_family()
+ size = prop.get_size_in_points()
+ weight = prop.get_weight()
+ style = prop.get_style()
+ gc.draw_text(x, y, unicode(s), family, size, weight, style, angle)
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ if ismath=='TeX':
+ # TODO: handle props
+ size = prop.get_size_in_points()
+ texmanager = self.get_texmanager()
+ Z = texmanager.get_grey(s, size, self.dpi)
+ m,n = Z.shape
+ # TODO: handle descent; This is based on backend_agg.py
+ return n, m, 0
+ if ismath:
+ ox, oy, width, height, descent, fonts, used_characters = \
+ self.mathtext_parser.parse(s, self.dpi, prop)
+ return width, height, descent
+ family = prop.get_family()
+ size = prop.get_size_in_points()
+ weight = prop.get_weight()
+ style = prop.get_style()
+ return self.gc.get_text_width_height_descent(unicode(s), family, size, weight, style)
+
+ def flipy(self):
+ return False
+
+ def points_to_pixels(self, points):
+ return points/72.0 * self.dpi
+
+ def option_image_nocomposite(self):
+ return True
+
+class GraphicsContextMac(_macosx.GraphicsContext, GraphicsContextBase):
+ """
+ The GraphicsContext wraps a Quartz graphics context. All methods
+ are implemented at the C-level in macosx.GraphicsContext. These
+ methods set drawing properties such as the line style, fill color,
+ etc. The actual drawing is done by the Renderer, which draws into
+ the GraphicsContext.
+ """
+ def __init__(self):
+ GraphicsContextBase.__init__(self)
+ _macosx.GraphicsContext.__init__(self)
+
+ def set_clip_rectangle(self, box):
+ GraphicsContextBase.set_clip_rectangle(self, box)
+ if not box: return
+ _macosx.GraphicsContext.set_clip_rectangle(self, box.bounds)
+
+ def set_clip_path(self, path):
+ GraphicsContextBase.set_clip_path(self, path)
+ if not path: return
+ path = path.get_fully_transformed_path()
+ for points, code in path.iter_segments():
+ if code == Path.MOVETO:
+ self.moveto(points)
+ elif code == Path.LINETO:
+ self.lineto(points)
+ elif code == Path.CURVE3:
+ self.curve3(points)
+ elif code == Path.CURVE4:
+ self.curve4(points)
+ elif code == Path.CLOSEPOLY:
+ self.closepoly()
+ self.clip_path()
+
+
+########################################################################
+#
+# The following functions and classes are for pylab and implement
+# window/figure managers, etc...
+#
+########################################################################
+
+def draw_if_interactive():
+ """
+ For performance reasons, we don't want to redraw the figure after
+ each draw command. Instead, we mark the figure as invalid, so that
+ it will be redrawn as soon as the event loop resumes via PyOS_InputHook.
+ This function should be called after each draw event, even if
+ matplotlib is not running interactively.
+ """
+ figManager = Gcf.get_active()
+ if figManager is not None:
+ figManager.canvas.invalidate()
+
+def new_figure_manager(num, *args, **kwargs):
+ """
+ Create a new figure manager instance
+ """
+ FigureClass = kwargs.pop('FigureClass', Figure)
+ figure = FigureClass(*args, **kwargs)
+ canvas = FigureCanvasMac(figure)
+ manager = FigureManagerMac(canvas, num)
+ return manager
+
+class FigureCanvasMac(_macosx.FigureCanvas, FigureCanvasBase):
+ """
+ The canvas the figure renders into. Calls the draw and print fig
+ methods, creates the renderers, etc...
+
+ Public attribute
+
+ figure - A Figure instance
+
+ Events such as button presses, mouse movements, and key presses
+ are handled in the C code and the base class methods
+ button_press_event, button_release_event, motion_notify_event,
+ key_press_event, and key_release_event are called from there.
+ """
+
+ def __init__(self, figure):
+ FigureCanvasBase.__init__(self, figure)
+ width, height = self.get_width_height()
+ self.renderer = RendererMac(figure.dpi, width, height)
+ _macosx.FigureCanvas.__init__(self, width, height)
+
+ def resize(self, width, height):
+ self.renderer.set_width_height(width, height)
+ dpi = self.figure.dpi
+ width /= dpi
+ height /= dpi
+ self.figure.set_size_inches(width, height)
+
+ def print_figure(self, filename, dpi=None, facecolor='w', edgecolor='w',
+ orientation='portrait', **kwargs):
+ if dpi is None: dpi = matplotlib.rcParams['savefig.dpi']
+ filename = unicode(filename)
+ root, ext = os.path.splitext(filename)
+ ext = ext[1:].lower()
+ if not ext:
+ ext = "png"
+ filename = root + "." + ext
+ if ext=="jpg": ext = "jpeg"
+
+ # save the figure settings
+ origfacecolor = self.figure.get_facecolor()
+ origedgecolor = self.figure.get_edgecolor()
+
+ # set the new parameters
+ self.figure.set_facecolor(facecolor)
+ self.figure.set_edgecolor(edgecolor)
+
+ if ext in ('jpeg', 'png', 'tiff', 'gif', 'bmp'):
+ width, height = self.figure.get_size_inches()
+ width, height = width*dpi, height*dpi
+ self.write_bitmap(filename, width, height)
+ elif ext == 'pdf':
+ self.write_pdf(filename)
+ elif ext in ('ps', 'eps'):
+ from backend_ps import FigureCanvasPS
+ # Postscript backend changes figure.dpi, but doesn't change it back
+ origDPI = self.figure.dpi
+ fc = self.switch_backends(FigureCanvasPS)
+ fc.print_figure(filename, dpi, facecolor, edgecolor,
+ orientation, **kwargs)
+ self.figure.dpi = origDPI
+ self.figure.set_canvas(self)
+ elif ext=='svg':
+ from backend_svg import FigureCanvasSVG
+ fc = self.switch_backends(FigureCanvasSVG)
+ fc.print_figure(filename, dpi, facecolor, edgecolor,
+ orientation, **kwargs)
+ self.figure.set_canvas(self)
+ else:
+ raise ValueError("Figure format not available (extension %s)" % ext)
+
+ # restore original figure settings
+ self.figure.set_facecolor(origfacecolor)
+ self.figure.set_edgecolor(origedgecolor)
+
+
+
+class FigureManagerMac(_macosx.FigureManager, FigureManagerBase):
+ """
+ Wrap everything up into a window for the pylab interface
+ """
+ def __init__(self, canvas, num):
+ FigureManagerBase.__init__(self, canvas, num)
+ title = "Figure %d" % num
+ _macosx.FigureManager.__init__(self, canvas, title)
+ if matplotlib.rcParams['toolbar']=='classic':
+ self.toolbar = NavigationToolbarMac(canvas)
+ elif matplotlib.rcParams['toolbar']=='toolbar2':
+ self.toolbar = NavigationToolbar2Mac(canvas)
+ else:
+ self.toolbar = None
+ if self.toolbar is not None:
+ self.toolbar.update()
+
+ def notify_axes_change(fig):
+ 'this will be called whenever the current axes is changed'
+ if self.toolbar != None: self.toolbar.update()
+ self.canvas.figure.add_axobserver(notify_axes_change)
+
+ # This is ugly, but this is what tkagg and gtk are doing.
+ # It is needed to get ginput() working.
+ self.canvas.figure.show = lambda *args: self.show()
+
+ def show(self):
+ self.canvas.draw()
+
+ def close(self):
+ Gcf.destroy(self.num)
+
+class NavigationToolbarMac(_macosx.NavigationToolbar):
+
+ def __init__(self, canvas):
+ self.canvas = canvas
+ basedir = os.path.join(matplotlib.rcParams['datapath'], "images")
+ images = {}
+ for imagename in ("stock_left",
+ "stock_right",
+ "stock_up",
+ "stock_down",
+ "stock_zoom-in",
+ "stock_zoom-out",
+ "stock_save_as"):
+ filename = os.path.join(basedir, imagename+".ppm")
+ images[imagename] = self._read_ppm_image(filename)
+ _macosx.NavigationToolbar.__init__(self, images)
+ self.message = None
+
+ def _read_ppm_image(self, filename):
+ data = ""
+ imagefile = open(filename)
+ for line in imagefile:
+ if "#" in line:
+ i = line.index("#")
+ line = line[:i] + "\n"
+ data += line
+ imagefile.close()
+ magic, width, height, maxcolor, imagedata = data.split(None, 4)
+ width, height = int(width), int(height)
+ assert magic=="P6"
+ assert len(imagedata)==width*height*3 # 3 colors in RGB
+ return (width, height, imagedata)
+
+ def panx(self, direction):
+ axes = self.canvas.figure.axes
+ selected = self.get_active()
+ for i in selected:
+ axes[i].xaxis.pan(direction)
+ self.canvas.invalidate()
+
+ def pany(self, direction):
+ axes = self.canvas.figure.axes
+ selected = self.get_active()
+ for i in selected:
+ axes[i].yaxis.pan(direction)
+ self.canvas.invalidate()
+
+ def zoomx(self, direction):
+ axes = self.canvas.figure.axes
+ selected = self.get_active()
+ for i in selected:
+ axes[i].xaxis.zoom(direction)
+ self.canvas.invalidate()
+
+ def zoomy(self, direction):
+ axes = self.canvas.figure.axes
+ selected = self.get_active()
+ for i in selected:
+ axes[i].yaxis.zoom(direction)
+ self.canvas.invalidate()
+
+ def save_figure(self):
+ filename = _macosx.choose_save_file('Save the figure')
+ if filename is None: # Cancel
+ return
+ self.canvas.print_figure(filename)
+
+class NavigationToolbar2Mac(_macosx.NavigationToolbar2, NavigationToolbar2):
+
+ def __init__(self, canvas):
+ NavigationToolbar2.__init__(self, canvas)
+
+ def _init_toolbar(self):
+ basedir = os.path.join(matplotlib.rcParams['datapath'], "images")
+ _macosx.NavigationToolbar2.__init__(self, basedir)
+
+ def draw_rubberband(self, event, x0, y0, x1, y1):
+ self.canvas.set_rubberband(x0, y0, x1, y1)
+
+ def release(self, event):
+ self.canvas.remove_rubberband()
+
+ def set_cursor(self, cursor):
+ _macosx.set_cursor(cursor)
+
+ def save_figure(self):
+ filename = _macosx.choose_save_file('Save the figure')
+ if filename is None: # Cancel
+ return
+ self.canvas.print_figure(filename)
+
+ def prepare_configure_subplots(self):
+ toolfig = Figure(figsize=(6,3))
+ canvas = FigureCanvasMac(toolfig)
+ toolfig.subplots_adjust(top=0.9)
+ tool = SubplotTool(self.canvas.figure, toolfig)
+ return canvas
+
+ def set_message(self, message):
+ _macosx.NavigationToolbar2.set_message(self, message.encode('utf-8'))
+
+########################################################################
+#
+# Now just provide the standard names that backend.__init__ is expecting
+#
+########################################################################
+
+
+FigureManager = FigureManagerMac
Added: trunk/matplotlib/src/_macosx.m
===================================================================
--- trunk/matplotlib/src/_macosx.m (rev 0)
+++ trunk/matplotlib/src/_macosx.m 2008-12-09 03:51:35 UTC (rev 6531)
@@ -0,0 +1,3773 @@
+#include <Cocoa/Cocoa.h>
+#include <ApplicationServices/ApplicationServices.h>
+#include <sys/socket.h>
+#include <Python.h>
+#include "numpy/arrayobject.h"
+
+static int nwin = 0;
+
+
+/* Varius NSApplicationDefined event subtypes */
+#define STDIN_READY 0
+#define SIGINT_CALLED 1
+#define STOP_EVENT_LOOP 2
+#define WINDOW_CLOSING 3
+
+/* -------------------------- Helper function ---------------------------- */
+
+static void stdin_ready(CFReadStreamRef readStream, CFStreamEventType eventType, void* context)
+{
+ NSEvent* event = [NSEvent otherEventWithType: NSApplicationDefined
+ location: NSZeroPoint
+ modifierFlags: 0
+ timestamp: 0.0
+ windowNumber: 0
+ context: nil
+ subtype: STDIN_READY
+ data1: 0
+ data2: 0];
+ [NSApp postEvent: event atStart: true];
+}
+
+static int sigint_fd = -1;
+
+static void _sigint_handler(int sig)
+{
+ const char c = 'i';
+ write(sigint_fd, &c, 1);
+}
+
+static void _callback(CFSocketRef s,
+ CFSocketCallBackType type,
+ CFDataRef address,
+ const void * data,
+ void *info)
+{
+ char c;
+ CFSocketNativeHandle handle = CFSocketGetNative(s);
+ read(handle, &c, 1);
+ NSEvent* event = [NSEvent otherEventWithType: NSApplicationDefined
+ location: NSZeroPoint
+ modifierFlags: 0
+ timestamp: 0.0
+ windowNumber: 0
+ context: nil
+ subtype: SIGINT_CALLED
+ data1: 0
+ data2: 0];
+ [NSApp postEvent: event atStart: true];
+}
+
+static int wait_for_stdin(void)
+{
+ const UInt8 buffer[] = "/dev/fd/0";
+ const CFIndex n = (CFIndex)strlen((char*)buffer);
+ CFRunLoopRef runloop = CFRunLoopGetCurrent();
+ CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+ buffer,
+ n,
+ false);
+ CFReadStreamRef stream = CFReadStreamCreateWithFile(kCFAllocatorDefault,
+ url);
+ CFRelease(url);
+
+ CFReadStreamOpen(stream);
+ if (!CFReadStreamHasBytesAvailable(stream))
+ /* This is possible because of how PyOS_InputHook is called from Python */
+ {
+ int error;
+ int interrupted = 0;
+ int channel[2];
+ CFSocketRef sigint_socket = NULL;
+ PyOS_sighandler_t py_sigint_handler = NULL;
+ CFStreamClientContext clientContext = {0, NULL, NULL, NULL, NULL};
+ CFReadStreamSetClient(stream,
+ kCFStreamEventHasBytesAvailable,
+ stdin_ready,
+ &clientContext);
+ CFReadStreamScheduleWithRunLoop(stream, runloop, kCFRunLoopCommonModes);
+ error = pipe(channel);
+ if (error==0)
+ {
+ fcntl(channel[1], F_SETFL, O_WRONLY | O_NONBLOCK);
+
+ sigint_socket = CFSocketCreateWithNative(kCFAllocatorDefault,
+ channel[0],
+ kCFSocketReadCallBack,
+ _callback,
+ NULL);
+ if (sigint_socket)
+ {
+ CFRunLoopSourceRef source;
+ source = CFSocketCreateRunLoopSource(kCFAllocatorDefault,
+ sigint_socket,
+ 0);
+ CFRelease(sigint_socket);
+ if (source)
+ {
+ CFRunLoopAddSource(runloop, source, kCFRunLoopDefaultMode);
+ CFRelease(source);
+ sigint_fd = channel[1];
+ py_sigint_handler = PyOS_setsig(SIGINT, _sigint_handler);
+ }
+ }
+ else
+ close(channel[0]);
+ }
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSDate* date = [NSDate distantFuture];
+ while (true)
+ { NSEvent* event = [NSApp nextEventMatchingMask: NSAnyEventMask
+ untilDate: date
+ inMode: NSDefaultRunLoopMode
+ dequeue: YES];
+ if (!event) break; /* No windows open */
+ if ([event type]==NSApplicationDefined)
+ { short subtype = [event subtype];
+ if (subtype==STDIN_READY) break;
+ if (subtype==SIGINT_CALLED)
+ { interrupted = true;
+ break;
+ }
+ }
+ [NSApp sendEvent: event];
+ }
+ [pool release];
+
+ if (py_sigint_handler) PyOS_setsig(SIGINT, py_sigint_handler);
+ CFReadStreamUnscheduleFromRunLoop(stream,
+ runloop,
+ kCFRunLoopCommonModes);
+ if (sigint_socket) CFSocketInvalidate(sigint_socket);
+ if (error==0) close(channel[1]);
+ if (interrupted) raise(SIGINT);
+ }
+ CFReadStreamClose(stream);
+ return 1;
+}
+
+static char show__doc__[] = "Show all the figures and enter the main loop.\nThis function does not return until all Matplotlib windows are closed,\nand is normally not needed in interactive sessions.";
+
+/* ---------------------------- Cocoa classes ---------------------------- */
+
+
+@interface Window : NSWindow
+{ PyObject* manager;
+}
+- (Window*)initWithContentRect:(NSRect)rect styleMask:(unsigned int)mask backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation withManager: (PyObject*)theManager;
+- (BOOL)closeButtonPressed;
+- (void)close;
+- (void)dealloc;
+@end
+
+@interface ToolWindow : NSWindow
+{
+}
+- (ToolWindow*)initWithContentRect:(NSRect)rect master:(NSWindow*)window;
+- (void)masterCloses:(NSNotification*)notification;
+- (void)close;
+@end
+
+@interface View : NSView
+{ PyObject* canvas;
+ NSRect rubberband;
+}
+- (void)dealloc;
+- (void)drawRect:(NSRect)rect;
+- (void)windowDidResize:(NSNotification*)notification;
+- (View*)initWithFrame:(NSRect)rect canvas:(PyObject*)fc;
+- (BOOL)windowShouldClose:(NSNotification*)notification;
+- (BOOL)isFlipped;
+- (void)mouseDown:(NSEvent*)event;
+- (void)mouseUp:(NSEvent*)event;
+- (void)mouseDragged:(NSEvent*)event;
+- (void)mouseMoved:(NSEvent*)event;
+- (void)setRubberband:(NSRect)rect;
+- (void)removeRubberband;
+- (const char*)convertKeyEvent:(NSEvent*)event;
+- (void)keyDown:(NSEvent*)event;
+- (void)keyUp:(NSEvent*)event;
+- (void)scrollWheel:(NSEvent *)event;
+- (void)flagsChanged:(NSEvent*)event;
+@end
+
+@interface ScrollableButton : NSButton
+{
+ SEL scrollWheelUpAction;
+ SEL scrollWheelDownAction;
+}
+- (void)setScrollWheelUpAction:(SEL)action;
+- (void)setScrollWheelDownAction:(SEL)action;
+- (void)scrollWheel:(NSEvent *)event;
+@end
+
+@interface MenuItem: NSMenuItem
+{ int index;
+}
++ (MenuItem*)menuItemWithTitle:(NSString*)title;
++ (MenuItem*)menuItemSelectAll;
++ (MenuItem*)menuItemInvertAll;
++ (MenuItem*)menuItemForAxis:(int)i;
+- (void)toggle:(id)sender;
+- (void)selectAll:(id)sender;
+- (void)invertAll:(id)sender;
+- (int)index;
+@end
+
+/* ---------------------------- Python classes ---------------------------- */
+
+typedef struct {
+ PyObject_HEAD
+ CGContextRef cr;
+ PyObject* converter; /* Convert color specifications to r,g,b triples */
+ CGPatternRef pattern; /* For drawing hatches */
+ ATSUStyle style; /* For drawing Unicode strings with ATSUI */
+ ATSUTextLayout layout; /* For drawing Unicode strings with ATSUI */
+} GraphicsContext;
+
+static PyObject*
+GraphicsContext_new(PyTypeObject* type, PyObject *args, PyObject *kwds)
+{
+ OSStatus status;
+
+ GraphicsContext* self = (GraphicsContext*)type->tp_alloc(type, 0);
+ if (!self) return NULL;
+ self->cr = NULL;
+ PyObject* module = PyImport_AddModule("matplotlib.colors");
+ if (!module) return NULL;
+ PyObject* dict = PyObject_GetAttrString(module, "__dict__");
+ if (!dict) return NULL;
+ PyObject* colorConverter = PyDict_GetItemString(dict, "colorConverter");
+ Py_DECREF(dict);
+ if (!colorConverter)
+ {
+ PyErr_SetString(PyExc_KeyError,
+ "failed to find colorConverter in matplotlib.colors");
+ return NULL;
+ }
+ self->converter = PyObject_GetAttrString(colorConverter, "to_rgb");
+ if (!self->converter) return NULL;
+
+ self->pattern = NULL;
+
+ status = ATSUCreateStyle(&self->style);
+ if (status!=noErr)
+ {
+ Py_DECREF(self->converter);
+ PyErr_SetString(PyExc_RuntimeError, "ATSUCreateStyle failed");
+ return NULL;
+ }
+
+ status = ATSUCreateTextLayout(&self->layout);
+ if (status!=noErr)
+ {
+ Py_DECREF(self->converter);
+ status = ATSUDisposeStyle(self->style);
+ if (status!=noErr)
+ PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeStyle failed", 1);
+ PyErr_SetString(PyExc_RuntimeError, "ATSUCreateTextLayout failed");
+ return NULL;
+ }
+
+ return (PyObject*) self;
+}
+
+static void
+GraphicsContext_dealloc(GraphicsContext *self)
+{
+ Py_DECREF(self->converter);
+
+ if (self->pattern) CGPatternRelease(self->pattern);
+
+ OSStatus status;
+
+ status = ATSUDisposeStyle(self->style);
+ if (status!=noErr)
+ PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeStyle failed", 1);
+
+ status = ATSUDisposeTextLayout(self->layout);
+ if (status!=noErr)
+ PyErr_WarnEx(PyExc_RuntimeWarning, "ATSUDisposeTextLayout failed", 1);
+
+ self->ob_type->tp_free((PyObject*)self);
+}
+
+static PyObject*
+GraphicsContext_repr(GraphicsContext* self)
+{
+ return PyString_FromFormat("GraphicsContext object %p wrapping the Quartz 2D graphics context %p", self, self->cr);
+}
+
+static PyObject*
+GraphicsContext_reset (GraphicsContext* self)
+{
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+ CGContextRestoreGState(cr);
+ CGContextSaveGState(cr);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_alpha (GraphicsContext* self, PyObject* args)
+{
+ float alpha;
+ if (!PyArg_ParseTuple(args, "f", &alpha)) return NULL;
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+ CGContextSetAlpha(cr, alpha);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_antialiased (GraphicsContext* self, PyObject* args)
+{
+ int shouldAntialias;
+ if (!PyArg_ParseTuple(args, "i", &shouldAntialias)) return NULL;
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+ CGContextSetShouldAntialias(cr, shouldAntialias);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_capstyle (GraphicsContext* self, PyObject* args)
+{
+ char* string;
+ CGLineCap cap;
+
+ if (!PyArg_ParseTuple(args, "s", &string)) return NULL;
+
+ if (!strcmp(string, "butt")) cap = kCGLineCapButt;
+ else if (!strcmp(string, "round")) cap = kCGLineCapRound;
+ else if (!strcmp(string, "projecting")) cap = kCGLineCapSquare;
+ else
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "capstyle should be 'butt', 'round', or 'projecting'");
+ return NULL;
+ }
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+ CGContextSetLineCap(cr, cap);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_clip_rectangle (GraphicsContext* self, PyObject* args)
+{
+ CGRect rect;
+ float x, y, width, height;
+ if (!PyArg_ParseTuple(args, "(ffff)", &x, &y, &width, &height)) return NULL;
+
+ rect.origin.x = x;
+ rect.origin.y = y;
+ rect.size.width = width;
+ rect.size.height = height;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ CGContextClipToRect(cr, rect);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_clip_path (GraphicsContext* self)
+{
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+ CGContextRestoreGState(cr);
+ CGContextSaveGState(cr);
+ CGContextClip(cr);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_dashes (GraphicsContext* self, PyObject* args)
+{
+ float phase = 0.0;
+ PyObject* offset;
+ PyObject* dashes;
+
+ if (!PyArg_ParseTuple(args, "OO", &offset, &dashes)) return NULL;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if (offset!=Py_None)
+ {
+ if (PyFloat_Check(offset)) phase = PyFloat_AsDouble(offset);
+ else if (PyInt_Check(offset)) phase = PyInt_AsLong(offset);
+ else
+ {
+ PyErr_SetString(PyExc_TypeError,
+ "offset should be a floating point value");
+ return NULL;
+ }
+ }
+
+ if (dashes!=Py_None)
+ {
+ if (PyList_Check(dashes)) dashes = PyList_AsTuple(dashes);
+ else if (PyTuple_Check(dashes)) Py_INCREF(dashes);
+ else
+ {
+ PyErr_SetString(PyExc_TypeError,
+ "dashes should be a tuple or a list");
+ return NULL;
+ }
+ int n = PyTuple_GET_SIZE(dashes);
+ int i;
+ float* lengths = malloc(n*sizeof(float));
+ if(!lengths)
+ {
+ PyErr_SetString(PyExc_MemoryError, "Failed to store dashes");
+ Py_DECREF(dashes);
+ return NULL;
+ }
+ for (i = 0; i < n; i++)
+ {
+ PyObject* value = PyTuple_GET_ITEM(dashes, i);
+ if (PyFloat_Check(value))
+ lengths[i] = (float) PyFloat_AS_DOUBLE(value);
+ else if (PyInt_Check(value))
+ lengths[i] = (float) PyInt_AS_LONG(value);
+ else break;
+ }
+ Py_DECREF(dashes);
+ if (i < n) /* break encountered */
+ {
+ free(lengths);
+ PyErr_SetString(PyExc_TypeError, "Failed to read dashes");
+ return NULL;
+ }
+ CGContextSetLineDash(cr, phase, lengths, n);
+ free(lengths);
+ }
+ else
+ CGContextSetLineDash(cr, phase, NULL, 0);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_foreground(GraphicsContext* self, PyObject* args, PyObject* keywords)
+{ float r, g, b;
+ PyObject* fg;
+ int isRGB = 0;
+ static char* kwlist[] = {"fg", "isRGB", NULL};
+ if(!PyArg_ParseTupleAndKeywords(args, keywords, "O|i", kwlist,
+ &fg, &isRGB)) return NULL;
+ if (isRGB)
+ {
+ if(!PyArg_ParseTuple(fg, "fff", &r, &g, &b)) return NULL;
+ }
+ else
+ { fg = PyObject_CallFunctionObjArgs(self->converter, fg, NULL);
+ if(!fg) return NULL;
+ if(!PyArg_ParseTuple(fg, "fff", &r, &g, &b)) return NULL;
+ Py_DECREF(fg);
+ }
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ CGContextSetRGBStrokeColor(cr, r, g, b, 1.0);
+ CGContextSetRGBFillColor(cr, r, g, b, 1.0);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_graylevel(GraphicsContext* self, PyObject* args)
+{ float gray;
+ if(!PyArg_ParseTuple(args, "f", &gray)) return NULL;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ CGContextSetGrayStrokeColor(cr, gray, 1.0);
+ CGContextSetGrayFillColor(cr, gray, 1.0);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static void drawHatch (void *info, CGContextRef cr)
+{
+ int i;
+
+ PyObject* string = (PyObject*)info;
+ char* hatches = PyString_AS_STRING(string);
+
+ int frequency[4] = {0, 0, 0, 0};
+ float position, distance;
+
+ const float size = 12.0;
+ const int n = strlen(hatches);
+
+ for (i = 0; i < n; i++)
+ {
+ switch(hatches[i])
+ {
+ case '/': frequency[3]++; break;
+ case '\\': frequency[2]++; break;
+ case '|': frequency[1]++; break;
+ case '-': frequency[0]++; break;
+ case '+': frequency[0]++; frequency[1]++; break;
+ case 'x': frequency[2]++; frequency[3]++; break;
+ }
+ }
+
+ distance = size / frequency[0];
+ position = distance / 2.0;
+ for (i = 0; i < frequency[0]; i++, position += distance)
+ {
+ CGContextMoveToPoint(cr, 0.0, position);
+ CGContextAddLineToPoint(cr, size, position);
+ }
+ distance = size / frequency[1];
+ position = distance / 2.0;
+ for (i = 0; i < frequency[1]; i++, position += distance)
+ {
+ CGContextMoveToPoint(cr, position, 0.0);
+ CGContextAddLineToPoint(cr, position, size);
+ }
+ distance = size / frequency[2];
+ position = distance / 2.0;
+ for (i = 0; i < frequency[2]; i++, position += distance)
+ {
+ CGContextMoveToPoint(cr, position, 0.0);
+ CGContextAddLineToPoint(cr, 0.0, position);
+ CGContextMoveToPoint(cr, position, size);
+ CGContextAddLineToPoint(cr, size, position);
+ }
+ distance = size / frequency[3];
+ position = distance / 2.0;
+ for (i = 0; i < frequency[3]; i++, position += distance)
+ {
+ CGContextMoveToPoint(cr, position, 0.0);
+ CGContextAddLineToPoint(cr, size, size-position);
+ CGContextMoveToPoint(cr, position, size);
+ CGContextAddLineToPoint(cr, 0.0, size-position);
+ }
+ CGContextSetLineWidth(cr, 2.0);
+ CGContextSetLineCap(cr, kCGLineCapSquare);
+ CGContextStrokePath(cr);
+
+ Py_DECREF(string);
+}
+
+static PyObject*
+GraphicsContext_set_hatch(GraphicsContext* self, PyObject* args)
+{ PyObject* hatches;
+
+ const float size = 12.0;
+ static const CGPatternCallbacks callbacks = {0, &drawHatch, NULL};
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "O", &hatches)) return NULL;
+ if(!PyString_Check(hatches)) return NULL;
+
+ Py_INCREF(hatches);
+
+ CGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB();
+ CGColorSpaceRef patternSpace = CGColorSpaceCreatePattern(baseSpace);
+ CGColorSpaceRelease(baseSpace);
+ CGContextSetFillColorSpace(cr, patternSpace);
+ CGColorSpaceRelease(patternSpace);
+
+ self->pattern = CGPatternCreate((void*)hatches,
+ CGRectMake(0, 0, size, size),
+ CGAffineTransformIdentity, size, size,
+ kCGPatternTilingNoDistortion,
+ false,
+ &callbacks);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_linewidth (GraphicsContext* self, PyObject* args)
+{
+ float width;
+ if (!PyArg_ParseTuple(args, "f", &width)) return NULL;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ CGContextSetLineWidth(cr, width);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_set_joinstyle(GraphicsContext* self, PyObject* args)
+{ char* string;
+ CGLineJoin join;
+
+ if (!PyArg_ParseTuple(args, "s", &string)) return NULL;
+
+ if (!strcmp(string, "miter")) join = kCGLineJoinMiter;
+ else if (!strcmp(string, "round")) join = kCGLineJoinRound;
+ else if (!strcmp(string, "bevel")) join = kCGLineJoinBevel;
+ else
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "joinstyle should be 'miter', 'round', or 'bevel'");
+ return NULL;
+ }
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+ CGContextSetLineJoin(cr, join);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_moveto(GraphicsContext* self, PyObject* args)
+{
+ float x;
+ float y;
+
+ if(!PyArg_ParseTuple(args, "(ff)", &x, &y)) return NULL;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+ CGContextMoveToPoint(cr, x, y);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_lineto(GraphicsContext* self, PyObject* args)
+{
+ float x;
+ float y;
+
+ if(!PyArg_ParseTuple(args, "(ff)", &x, &y)) return NULL;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+ CGContextAddLineToPoint(cr, x, y);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_curve3(GraphicsContext* self, PyObject* args)
+{
+ float cpx;
+ float cpy;
+ float x;
+ float y;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "(ffff)", &cpx,
+ &cpy,
+ &x,
+ &y)) return NULL;
+
+ CGContextAddQuadCurveToPoint(cr, cpx, cpy, x, y);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_curve4 (GraphicsContext* self, PyObject* args)
+{
+ float cp1x;
+ float cp1y;
+ float cp2x;
+ float cp2y;
+ float x;
+ float y;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "(ffffff)", &cp1x,
+ &cp1y,
+ &cp2x,
+ &cp2y,
+ &x,
+ &y)) return NULL;
+
+ CGContextAddCurveToPoint(cr, cp1x, cp1y, cp2x, cp2y, x, y);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_closepoly (GraphicsContext* self)
+{
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ CGContextClosePath(cr);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_stroke (GraphicsContext* self, PyObject* args)
+{
+ PyObject* color;
+ CGContextRef cr = self->cr;
+
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "O", &color)) return NULL;
+
+ if(color!=Py_None)
+ {
+ float r, g, b;
+ if(!PyArg_ParseTuple(color, "fff", &r, &g, &b)) return NULL;
+ if(self->pattern)
+ {
+ float components[4];
+ components[0] = r;
+ components[1] = g;
+ components[2] = b;
+ components[3] = 1.0;
+ CGContextSetFillPattern(cr, self->pattern, components);
+ CGPatternRelease (self->pattern);
+ self->pattern = nil;
+ }
+ else CGContextSetRGBFillColor(cr, r, g, b, 1.0);
+ CGContextDrawPath(cr, kCGPathFillStroke);
+ }
+ else CGContextStrokePath(cr);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static ATSFontRef
+setfont(CGContextRef cr, PyObject* family, float size, const char weight[],
+ const char style[])
+{
+#define NMAP 40
+#define NFONT 31
+ int i, j, n;
+ const char* temp;
+ const char* name = "Times-Roman";
+ CFStringRef string;
+ ATSFontRef atsfont = 0;
+
+ const int k = (strcmp(style, "italic") ? 0 : 2)
+ + (strcmp(weight, "bold") ? 0 : 1);
+
+ struct {char* name; int index;} map[NMAP] = {
+ {"New Century Schoolbook", 0},
+ {"Century Schoolbook L", 0},
+ {"Utopia", 1},
+ {"ITC Bookman", 2},
+ {"Bookman", 2},
+ {"Bitstream Vera Serif", 3},
+ {"Nimbus Roman No9 L", 4},
+ {"Times New Roman", 5},
+ {"Times", 6},
+ {"Palatino", 7},
+ {"Charter", 8},
+ {"serif", 0},
+ {"Lucida Grande", 9},
+ {"Verdana", 10},
+ {"Geneva", 11},
+ {"Lucida", 12},
+ {"Bitstream Vera Sans", 13},
+ {"Arial", 14},
+ {"Helvetica", 15},
+ {"Avant Garde", 16},
+ {"sans-serif", 10},
+ {"Apple Chancery", 17},
+ {"Textile", 18},
+ {"Zapf Chancery", 19},
+ {"Sand", 20},
+ {"cursive", 17},
+ {"Comic Sans MS", 21},
+ {"Chicago", 22},
+ {"Charcoal", 23},
+ {"Impact", 24},
+ {"Western", 25},
+ {"fantasy", 21},
+ {"Andale Mono", 26},
+ {"Bitstream Vera Sans Mono", 27},
+ {"Nimbus Mono L", 28},
+ {"Courier", 29},
+ {"Courier New", 30},
+ {"Fixed", 30},
+ {"Terminal", 30},
+ {"monospace", 30},
+ };
+
+ const char* psnames[NFONT][4] = {
+ {"CenturySchoolbook", /* 0 */
+ "CenturySchoolbook-Bold",
+ "CenturySchoolbook-Italic",
+ "CenturySchoolbook-BoldItalic"},
+ {"Utopia", /* 1 */
+ "Utopia-Bold",
+ "Utopia-Italic",
+ "Utopia-BoldItalic"},
+ {"Bookman-Light", /* 2 */
+ "Bookman-Bold",
+ "Bookman-LightItalic",
+ "Bookman-BoldItalic"},
+ {"BitstreamVeraSerif-Roman", /* 3 */
+ "BitstreamVeraSerif-Bold",
+ "",
+ ""},
+ {"NimbusRomNo9L-Reg", /* 4 */
+ "NimbusRomNo9T-Bol",
+ "NimbusRomNo9L-RegIta",
+ "NimbusRomNo9T-BolIta"},
+ {"TimesNewRomanPSMT", /* 5 */
+ "TimesNewRomanPS-BoldMT",
+ "TimesNewRomanPS-ItalicMT",
+ "TimesNewRomanPS-BoldItalicMT"},
+ {"Times-Roman", /* 6 */
+ "Times-Bold",
+ "Times-Italic",
+ "Times-BoldItalic"},
+ {"Palatino-Roman", /* 7 */
+ "Palatino-Bold",
+ "Palatino-Italic",
+ "Palatino-BoldItalic"},
+ {"CharterBT-Roman", /* 8 */
+ "CharterBT-Bold",
+ "CharterBT-Italic",
+ "CharterBT-BoldItalic"},
+ {"LucidaGrande", /* 9 */
+ "LucidaGrande-Bold",
+ "",
+ ""},
+ {"Verdana", /* 10 */
+ "Verdana-Bold",
+ "Verdana-Italic",
+ "Verdana-BoldItalic"},
+ {"Geneva", /* 11 */
+ "",
+ "",
+ ""},
+ {"LucidaSans", /* 12 */
+ "LucidaSans-Demi",
+ "LucidaSans-Italic",
+ "LucidaSans-DemiItalic"},
+ {"BitstreamVeraSans-Roman", /* 13 */
+ "BitstreamVeraSans-Bold",
+ "BitstreamVeraSans-Oblique",
+ "BitstreamVeraSans-BoldOblique"},
+ {"ArialMT", /* 14 */
+ "Arial-BoldMT",
+ "Arial-ItalicMT",
+ "Arial-BoldItalicMT"},
+ {"Helvetica", /* 15 */
+ "Helvetica-Bold",
+ "",
+ ""},
+ {"AvantGardeITC-Book", /* 16 */
+ "AvantGardeITC-Demi",
+ "AvantGardeITC-BookOblique",
+ "AvantGardeITC-DemiOblique"},
+ {"Apple-Chancery", /* 17 */
+ "",
+ "",
+ ""},
+ {"TextileRegular", /* 18 */
+ "",
+ "",
+ ""},
+ {"ZapfChancery-Roman", /* 19 */
+ "ZapfChancery-Bold",
+ "ZapfChancery-Italic",
+ "ZapfChancery-MediumItalic"},
+ {"SandRegular", /* 20 */
+ "",
+ "",
+ ""},
+ {"ComicSansMS", /* 21 */
+ "ComicSansMS-Bold",
+ "",
+ ""},
+ {"Chicago", /* 22 */
+ "",
+ "",
+ ""},
+ {"Charcoal", /* 23 */
+ "",
+ "",
+ ""},
+ {"Impact", /* 24 */
+ "",
+ "",
+ ""},
+ {"Playbill", /* 25 */
+ "",
+ "",
+ ""},
+ {"AndaleMono", /* 26 */
+ "",
+ "",
+ ""},
+ {"BitstreamVeraSansMono-Roman", /* 27 */
+ "BitstreamVeraSansMono-Bold",
+ "BitstreamVeraSansMono-Oblique",
+ "BitstreamVeraSansMono-BoldOb"},
+ {"NimbusMonL-Reg", /* 28 */
+ "NimbusMonL-Bol",
+ "NimbusMonL-RegObl",
+ "NimbusMonL-BolObl"},
+ {"Courier", /* 29 */
+ "Courier-Bold",
+ "",
+ ""},
+ {"CourierNewPS", /* 30 */
+ "CourierNewPS-BoldMT",
+ "CourierNewPS-ItalicMT",
+ "CourierNewPS-Bold-ItalicMT"},
+ };
+
+ if(!PyList_Check(family)) return 0;
+ n = PyList_GET_SIZE(family);
+
+ for (i = 0; i < n; i++)
+ {
+ PyObject* item = PyList_GET_ITEM(family, i);
+ if(!PyString_Check(item)) return 0;
+ temp = PyString_AS_STRING(item);
+ for (j = 0; j < NMAP; j++)
+ { if (!strcmp(map[j].name, temp))
+ { temp = psnames[map[j].index][k];
+ break;
+ }
+ }
+ /* If the font name is not found in mapping, we assume */
+ /* that the user specified the Postscript name directly */
+
+ /* Check if this font can be found on the system */
+ string = CFStringCreateWithCString(kCFAllocatorDefault,
+ temp,
+ kCFStringEncodingMacRoman);
+ atsfont = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault);
+ CFRelease(string);
+
+ if(atsfont)
+ {
+ name = temp;
+ break;
+ }
+ }
+ if(!atsfont)
+ { string = CFStringCreateWithCString(kCFAllocatorDefault,
+ name,
+ kCFStringEncodingMacRoman);
+ atsfont = ATSFontFindFromPostScriptName(string, kATSOptionFlagsDefault);
+ CFRelease(string);
+ }
+ CGContextSelectFont(cr, name, size, kCGEncodingMacRoman);
+ return atsfont;
+}
+
+static PyObject*
+GraphicsContext_draw_text (GraphicsContext* self, PyObject* args)
+{
+ float x;
+ float y;
+ const UniChar* text;
+ int n;
+ PyObject* family;
+ float size;
+ const char* weight;
+ const char* style;
+ float angle;
+ ATSFontRef atsfont;
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "ffu#Ofssf",
+ &x,
+ &y,
+ &text,
+ &n,
+ &family,
+ &size,
+ &weight,
+ &style,
+ &angle)) return NULL;
+
+ atsfont = setfont(cr, family, size, weight, style);
+
+ OSStatus status;
+
+ ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, kATSUQDBoldfaceTag};
+ ByteCount sizes[] = {sizeof(ATSUFontID), sizeof(Fixed), sizeof(Boolean)};
+ Fixed atsuSize = Long2Fix(size);
+ Boolean isBold = FALSE; /* setfont takes care of this */
+
+ ATSUAttributeValuePtr values[] = {&atsfont, &atsuSize, &isBold};
+ status = ATSUSetAttributes(self->style, 3, tags, sizes, values);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetAttributes failed");
+ return NULL;
+ }
+
+ status = ATSUSetTextPointerLocation(self->layout,
+ text,
+ kATSUFromTextBeginning, // offset from beginning
+ kATSUToTextEnd, // length of text range
+ n); // length of text buffer
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ATSUCreateTextLayoutWithTextPtr failed");
+ return NULL;
+ }
+
+ status = ATSUSetRunStyle(self->layout,
+ self->style,
+ kATSUFromTextBeginning,
+ kATSUToTextEnd);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetRunStyle failed");
+ return NULL;
+ }
+
+ Fixed atsuAngle = X2Fix(angle);
+ ATSUAttributeTag tags2[] = {kATSUCGContextTag, kATSULineRotationTag};
+ ByteCount sizes2[] = {sizeof (CGContextRef), sizeof(Fixed)};
+ ATSUAttributeValuePtr values2[] = {&cr, &atsuAngle};
+ status = ATSUSetLayoutControls(self->layout, 2, tags2, sizes2, values2);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetLayoutControls failed");
+ return NULL;
+ }
+
+ status = ATSUDrawText(self->layout,
+ kATSUFromTextBeginning,
+ kATSUToTextEnd,
+ X2Fix(x),
+ X2Fix(y));
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUDrawText failed");
+ return NULL;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static void _data_provider_release(void* info, const void* data, size_t size)
+{
+ PyObject* image = (PyObject*)info;
+ Py_DECREF(image);
+}
+
+static PyObject*
+GraphicsContext_draw_mathtext(GraphicsContext* self, PyObject* args)
+{
+ float x, y, angle;
+ npy_intp nrows, ncols;
+ int n;
+
+ PyObject* object;
+ PyArrayObject* image;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "fffO", &x, &y, &angle, &object)) return NULL;
+
+ /* ------------- Check the image ---------------------------- */
+ if(!PyArray_Check (object))
+ {
+ PyErr_SetString(PyExc_TypeError, "image should be a NumPy array.");
+ return NULL;
+ }
+ image = (PyArrayObject*) object;
+ if(PyArray_NDIM(image) != 2)
+ {
+ PyErr_Format(PyExc_TypeError,
+ "image has incorrect rank (%d expected 2)",
+ PyArray_NDIM(image));
+ return NULL;
+ }
+ if (PyArray_TYPE(image) != NPY_UBYTE)
+ {
+ PyErr_SetString(PyExc_TypeError,
+ "image has incorrect type (should be uint8)");
+ return NULL;
+ }
+ if (!PyArray_ISCONTIGUOUS(image))
+ {
+ PyErr_SetString(PyExc_TypeError, "image array is not contiguous");
+ return NULL;
+ }
+
+ nrows = PyArray_DIM(image, 0);
+ ncols = PyArray_DIM(image, 1);
+ if (nrows != (int) nrows || ncols != (int) ncols)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "bitmap image too large");
+ return NULL;
+ }
+ n = nrows * ncols;
+ Py_INCREF(object);
+
+ const size_t bytesPerComponent = 1;
+ const size_t bitsPerComponent = 8 * bytesPerComponent;
+ const size_t nComponents = 1; /* gray */
+ const size_t bitsPerPixel = bitsPerComponent * nComponents;
+ const size_t bytesPerRow = nComponents * bytesPerComponent * ncols;
+ CGDataProviderRef provider = CGDataProviderCreateWithData(object,
+ PyArray_DATA(image),
+ n,
+ _data_provider_release);
+ CGImageRef bitmap = CGImageMaskCreate ((int) ncols,
+ (int) nrows,
+ bitsPerComponent,
+ bitsPerPixel,
+ bytesPerRow,
+ provider,
+ NULL,
+ false);
+ CGDataProviderRelease(provider);
+
+ if(!bitmap)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGImageMaskCreate failed");
+ return NULL;
+ }
+
+ if (angle==0.0)
+ {
+ CGContextDrawImage(cr, CGRectMake(x,y,ncols,nrows), bitmap);
+ }
+ else
+ {
+ CGContextSaveGState(cr);
+ CGContextTranslateCTM(cr, x, y);
+ CGContextRotateCTM(cr, angle*M_PI/180);
+ CGContextDrawImage(cr, CGRectMake(0,0,ncols,nrows), bitmap);
+ CGContextRestoreGState(cr);
+ }
+ CGImageRelease(bitmap);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+GraphicsContext_get_text_width_height_descent(GraphicsContext* self, PyObject* args)
+{
+ const UniChar* text;
+ int n;
+ PyObject* family;
+ float size;
+ const char* weight;
+ const char* style;
+
+ ATSFontRef atsfont;
+
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "u#Ofss", &text, &n, &family, &size, &weight, &style)) return NULL;
+
+ atsfont = setfont(cr, family, size, weight, style);
+
+ OSStatus status = noErr;
+ ATSUAttributeTag tags[] = {kATSUFontTag,
+ kATSUSizeTag,
+ kATSUQDBoldfaceTag,
+ kATSUQDItalicTag};
+ ByteCount sizes[] = {sizeof(ATSUFontID),
+ sizeof(Fixed),
+ sizeof(Boolean),
+ sizeof(Boolean)};
+ Fixed atsuSize = Long2Fix(size);
+ Boolean isBold = FALSE; /* setfont takes care of this */
+ Boolean isItalic = FALSE; /* setfont takes care of this */
+ ATSUAttributeValuePtr values[] = {&atsfont, &atsuSize, &isBold, &isItalic};
+
+ status = ATSUSetAttributes(self->style, 4, tags, sizes, values);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetAttributes failed");
+ return NULL;
+ }
+
+ status = ATSUSetTextPointerLocation(self->layout,
+ text,
+ kATSUFromTextBeginning, // offset from beginning
+ kATSUToTextEnd, // length of text range
+ n); // length of text buffer
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError,
+ "ATSUCreateTextLayoutWithTextPtr failed");
+ return NULL;
+ }
+
+ status = ATSUSetRunStyle(self->layout,
+ self->style,
+ kATSUFromTextBeginning,
+ kATSUToTextEnd);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetRunStyle failed");
+ return NULL;
+ }
+
+ ATSUAttributeTag tag = kATSUCGContextTag;
+ ByteCount bc = sizeof (CGContextRef);
+ ATSUAttributeValuePtr value = &cr;
+ status = ATSUSetLayoutControls(self->layout, 1, &tag, &bc, &value);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUSetLayoutControls failed");
+ return NULL;
+ }
+
+ ATSUTextMeasurement before;
+ ATSUTextMeasurement after;
+ ATSUTextMeasurement ascent;
+ ATSUTextMeasurement descent;
+ status = ATSUGetUnjustifiedBounds(self->layout,
+ kATSUFromTextBeginning, kATSUToTextEnd,
+ &before, &after, &ascent, &descent);
+ if (status!=noErr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "ATSUGetUnjustifiedBounds failed");
+ return NULL;
+ }
+
+ const float width = FixedToFloat(after-before);
+ const float height = FixedToFloat(ascent-descent);
+
+ return Py_BuildValue("fff", width, height, FixedToFloat(descent));
+}
+
+static PyObject*
+GraphicsContext_draw_image(GraphicsContext* self, PyObject* args)
+{
+ float x, y;
+ int nrows, ncols;
+ const char* data;
+ int n;
+ PyObject* image;
+ CGContextRef cr = self->cr;
+ if (!cr)
+ {
+ PyErr_SetString(PyExc_RuntimeError, "CGContextRef is NULL");
+ return NULL;
+ }
+
+ if(!PyArg_ParseTuple(args, "ffiiO", &x,
+ &y,
+ &nrows,
+ &ncols,
+ &image)) return NULL;
+
+ if (!PyString_Check(image))
+ {
+ PyErr_SetString(PyExc_RuntimeError, "image is not a string");
+ return NULL;
+ }
+
+ const size_t bytesPerComponent = 1;
+ const size_t bitsPerComponent = 8 * bytesPerComponent;
+ const size_t nComponents = 4; /* red, green, blue, alpha */
+ const size_t bitsPerPixel = bitsPerComponent * nComponents;
+ const size_t bytesPerRow = nComponents * bytesPerComponent * ncols;
+ CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
+
+ Py_INCREF(image);
+ n = PyString_GET_SIZE(image);
+ data = PyString_AsString(image);
+
+ CGDataProviderRef provider = CGDataProviderCreateWithData(image,
+ data,
+ n,
+ _data_provider_release);
+ CGImageRef bitmap = CGImageCreate (ncols,
+ nrows,
+ bitsPerComponent,
+ bitsPerPixel,
+ bytesPerRow,
+ colorspace,
+ kCGImageAlphaLast,
+ provider,
+ ...
[truncated message content] |
|
From: <jd...@us...> - 2008-12-09 03:49:15
|
Revision: 6530
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6530&view=rev
Author: jdh2358
Date: 2008-12-09 03:49:11 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
added mdehoon's native macosx patch
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/mathtext.py
trunk/matplotlib/lib/matplotlib/rcsetup.py
trunk/matplotlib/matplotlibrc.template
trunk/matplotlib/setup.cfg.template
trunk/matplotlib/setup.py
trunk/matplotlib/setupext.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-09 03:37:16 UTC (rev 6529)
+++ trunk/matplotlib/CHANGELOG 2008-12-09 03:49:11 UTC (rev 6530)
@@ -1,3 +1,5 @@
+2008-12-08 Added mdehoon's native maxosx backend from sf patch 2179017
+
2008-12-08 Removed the prints in the set_*style commands. Return the
list of pprinted strings instead
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-09 03:37:16 UTC (rev 6529)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-09 03:49:11 UTC (rev 6530)
@@ -2749,7 +2749,8 @@
'ps' : MathtextBackendPs,
'pdf' : MathtextBackendPdf,
'svg' : MathtextBackendSvg,
- 'cairo' : MathtextBackendCairo
+ 'cairo' : MathtextBackendCairo,
+ 'macosx': MathtextBackendAgg,
}
_font_type_mapping = {
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-09 03:37:16 UTC (rev 6529)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-09 03:49:11 UTC (rev 6530)
@@ -23,8 +23,8 @@
# The capitalized forms are needed for ipython at present; this may
# change for later versions.
-interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'Qt4Agg',
- 'TkAgg', 'WX', 'WXAgg', 'CocoaAgg']
+interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'MacOSX',
+ 'QtAgg', 'Qt4Agg', 'TkAgg', 'WX', 'WXAgg', 'CocoaAgg']
non_interactive_bk = ['agg', 'cairo', 'emf', 'gdk',
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template 2008-12-09 03:37:16 UTC (rev 6529)
+++ trunk/matplotlib/matplotlibrc.template 2008-12-09 03:49:11 UTC (rev 6530)
@@ -24,9 +24,9 @@
#### CONFIGURATION BEGINS HERE
# the default backend; one of GTK GTKAgg GTKCairo CocoaAgg FltkAgg
-# QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template You
-# can also deploy your own backend outside of matplotlib by referring
-# to the module name (which must be in the PYTHONPATH) as
+# MacOSX QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template
+# You can also deploy your own backend outside of matplotlib by
+# referring to the module name (which must be in the PYTHONPATH) as
# 'module://my_backend'
backend : %(backend)s
Modified: trunk/matplotlib/setup.cfg.template
===================================================================
--- trunk/matplotlib/setup.cfg.template 2008-12-09 03:37:16 UTC (rev 6529)
+++ trunk/matplotlib/setup.cfg.template 2008-12-09 03:49:11 UTC (rev 6530)
@@ -32,9 +32,9 @@
[gui_support]
# Matplotlib supports multiple GUI toolkits, including Cocoa,
-# GTK, Fltk, Qt, Qt4, Tk, and WX. Support for many of these
-# toolkits requires AGG, the Anti-Grain Geometry library, which
-# is provided by matplotlib and built by default.
+# GTK, Fltk, MacOSX, Qt, Qt4, Tk, and WX. Support for many of
+# these toolkits requires AGG, the Anti-Grain Geometry library,
+# which is provided by matplotlib and built by default.
#
# Some backends are written in pure Python, and others require
# extension code to be compiled. By default, matplotlib checks
@@ -59,16 +59,17 @@
#gtkagg = False
#tkagg = False
#wxagg = False
+#macosx = False
[rc_options]
# User-configurable options
#
-# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg,
-# GTKCairo, FltkAgg, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg.
+# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, GTKCairo,
+# FltkAgg, MacOSX, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg.
#
# The Agg, Ps, Pdf and SVG backends do not require external
-# dependencies. Do not choose GTK, GTKAgg, GTKCairo, TkAgg or WXAgg if
-# you have disabled the relevent extension modules. Agg will be used
+# dependencies. Do not choose GTK, GTKAgg, GTKCairo, MacOSX, TkAgg or WXAgg
+# if you have disabled the relevent extension modules. Agg will be used
# by default.
#
#backend = Agg
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2008-12-09 03:37:16 UTC (rev 6529)
+++ trunk/matplotlib/setup.py 2008-12-09 03:49:11 UTC (rev 6530)
@@ -26,15 +26,15 @@
import glob
from distutils.core import setup
from setupext import build_agg, build_gtkagg, build_tkagg, build_wxagg,\
- build_ft2font, build_image, build_windowing, build_path, \
+ build_macosx, build_ft2font, build_image, build_windowing, build_path, \
build_contour, build_delaunay, build_nxutils, build_traits, build_gdk, \
build_ttconv, print_line, print_status, print_message, \
print_raw, check_for_freetype, check_for_libpng, check_for_gtk, \
- check_for_tk, check_for_wx, check_for_numpy, check_for_qt, check_for_qt4, \
- check_for_cairo, check_provide_traits, check_provide_pytz, \
- check_provide_dateutil, check_provide_configobj, check_for_dvipng, \
- check_for_ghostscript, check_for_latex, check_for_pdftops, \
- check_for_datetime, options, build_png
+ check_for_tk, check_for_wx, check_for_macosx, check_for_numpy, \
+ check_for_qt, check_for_qt4, check_for_cairo, check_provide_traits, \
+ check_provide_pytz, check_provide_dateutil, check_provide_configobj, \
+ check_for_dvipng, check_for_ghostscript, check_for_latex, \
+ check_for_pdftops, check_for_datetime, options, build_png
#import distutils.sysconfig
# jdh
@@ -149,6 +149,11 @@
build_gtkagg(ext_modules, packages)
rc['backend'] = 'GTKAgg'
+if options['build_macosx']:
+ if check_for_macosx() or (options['build_macosx'] is True):
+ build_macosx(ext_modules, packages)
+ rc['backend'] = 'MacOSX'
+
# These are informational only. We don't build any extensions for them.
check_for_qt()
check_for_qt4()
Modified: trunk/matplotlib/setupext.py
===================================================================
--- trunk/matplotlib/setupext.py 2008-12-09 03:37:16 UTC (rev 6529)
+++ trunk/matplotlib/setupext.py 2008-12-09 03:49:11 UTC (rev 6530)
@@ -76,6 +76,7 @@
BUILT_TTCONV = False
BUILT_GTKAGG = False
BUILT_IMAGE = False
+BUILT_MACOSX = False
BUILT_TKAGG = False
BUILT_WXAGG = False
BUILT_WINDOWING = False
@@ -105,6 +106,7 @@
'build_gtkagg': 'auto',
'build_tkagg': 'auto',
'build_wxagg': 'auto',
+ 'build_macosx': 'auto',
'build_image': True,
'build_windowing': True,
'backend': None,
@@ -867,6 +869,17 @@
print_message(explanation)
return gotit
+def check_for_macosx():
+ gotit = False
+ import sys
+ if sys.platform=='darwin':
+ gotit = True
+ if gotit:
+ print_status("Mac OS X native", "yes")
+ else:
+ print_status("Mac OS X native", "no")
+ return gotit
+
def query_tcltk():
"""Tries to open a Tk window in order to query the Tk object about its library paths.
This should never be called more than once by the same process, as Tk intricacies
@@ -1214,6 +1227,19 @@
ext_modules.append(module)
BUILT_WXAGG = True
+
+def build_macosx(ext_modules, packages):
+ global BUILT_MACOSX
+ if BUILT_MACOSX: return # only build it if you you haven't already
+ module = Extension('matplotlib.backends._macosx',
+ ['src/_macosx.m'],
+ extra_link_args = ['-framework','Cocoa'],
+ )
+ add_numpy_flags(module)
+ ext_modules.append(module)
+ BUILT_MACOSX = True
+
+
def build_png(ext_modules, packages):
global BUILT_PNG
if BUILT_PNG: return # only build it if you you haven't already
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-09 03:37:20
|
Revision: 6529
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6529&view=rev
Author: jdh2358
Date: 2008-12-09 03:37:16 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
added missing comma to backend driver list
Modified Paths:
--------------
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-12-09 03:33:57 UTC (rev 6528)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-12-09 03:37:16 UTC (rev 6529)
@@ -221,7 +221,7 @@
'quad_bezier.py',
'scatter_piecharts.py',
'span_regions.py',
- 'two_scales.py'
+ 'two_scales.py',
'unicode_minus.py',
'watermark_image.py',
'watermark_text.py',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-09 03:34:02
|
Revision: 6528
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6528&view=rev
Author: jdh2358
Date: 2008-12-09 03:33:57 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
tweaks to backend driver list
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/tests/backend_driver.py
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-09 03:24:44 UTC (rev 6527)
+++ trunk/matplotlib/CHANGELOG 2008-12-09 03:33:57 UTC (rev 6528)
@@ -1,3 +1,6 @@
+2008-12-08 Removed the prints in the set_*style commands. Return the
+ list of pprinted strings instead
+
2008-12-08 Some of the changes Michael made to improve the output of
the property tables in the rest docs broke of made
difficult to use some of the interactive doc helpers, eg
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-12-09 03:24:44 UTC (rev 6527)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-12-09 03:33:57 UTC (rev 6528)
@@ -25,8 +25,8 @@
pylab_dir = os.path.join('..', 'pylab_examples')
pylab_files = [
- 'two_scales.py',
+
'accented_text.py',
'alignment_test.py',
'annotation_demo.py',
@@ -191,10 +191,8 @@
'unicode_demo.py',
'vertical_ticklabels.py',
'vline_demo.py',
- 'webapp_demo.py',
'xcorr_demo.py',
'zorder_demo.py',
-
]
@@ -202,13 +200,16 @@
api_files = [
'agg_oo.py',
'barchart_demo.py',
+ 'bbox_intersect.py',
'collections_demo.py',
+ 'color_cycle.py',
+ 'colorbar_only.py',
'custom_projection_example.py',
'custom_scale_example.py',
'date_demo.py',
'date_index_formatter.py',
+ 'donut_demo.py',
'font_family_rc.py',
- 'font_file.py',
'histogram_demo.py',
'image_zcoord.py',
'legend_demo.py',
@@ -216,19 +217,14 @@
'logo2.py',
'mathtext_asarray.py',
'patch_collection.py',
+ 'path_patch_demo.py',
+ 'quad_bezier.py',
'scatter_piecharts.py',
'span_regions.py',
+ 'two_scales.py'
'unicode_minus.py',
'watermark_image.py',
'watermark_text.py',
-
- 'bbox_intersect.py',
- 'colorbar_only.py',
- 'color_cycle.py',
- 'donut_demo.py',
- 'path_patch_demo.py',
- 'quad_bezier.py',
- 'two_scales.py'
]
units_dir = os.path.join('..', 'units')
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-12-09 03:24:44 UTC (rev 6527)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-12-09 03:33:57 UTC (rev 6528)
@@ -1494,19 +1494,19 @@
:class:`BoxStyle` is a container class which defines several
boxstyle classes, which are used for :class:`FancyBoxPatch`.
- A style object can be created as
+ A style object can be created as::
BoxStyle.Round(pad=0.2)
- or
+ or::
BoxStyle("Round", pad=0.2)
- or
+ or::
BoxStyle("Round, pad=0.2")
- Following boxstyle classes are defined.
+ The following boxstyle classes are defined.
%(AvailableBoxstyles)s
@@ -2026,7 +2026,7 @@
Old attrs simply are forgotten.
- Without argument (or with *boxstyle* = None), it prints out
+ Without argument (or with *boxstyle* = None), it returns
available box styles.
ACCEPTS: [ %(AvailableBoxstyles)s ]
@@ -2034,10 +2034,7 @@
"""
if boxstyle==None:
- # print out available boxstyles and return.
- print "Following box styles are available:"
- print BoxStyle.pprint_styles()
- return
+ return BoxStyle.pprint_styles()
if isinstance(boxstyle, BoxStyle._Base):
self._bbox_transmuter = boxstyle
@@ -2097,7 +2094,7 @@
return _path
- # Followong methods are borrowed from the Rectangle class.
+ # Following methods are borrowed from the Rectangle class.
def get_x(self):
"Return the left coord of the rectangle"
@@ -2183,19 +2180,19 @@
between two points. These are mainly used with
:class:`FancyArrowPatch`.
- A connectionstyle object can be either created as
+ A connectionstyle object can be either created as::
ConnectionStyle.Arc3(rad=0.2)
- or
+ or::
ConnectionStyle("Arc3", rad=0.2)
- or
+ or::
ConnectionStyle("Arc3, rad=0.2")
- Following classes are defined
+ The following classes are defined
%(AvailableConnectorstyles)s
@@ -2205,11 +2202,13 @@
__call__(self, posA, posB, patchA=None, patchB=None, shrinkA=2., shrinkB=2.)
- and it returns a :class:`Path` instance. *posA* and *posB are tuples
- of x,y coordinates of the two points to be connected. *patchA* (or
- $patchB*) is given, the returned path is clipped so that it start
- (or end) from the boundary of the patch. The path is further
- shrinked by *shrinkA* (or *shrinkB*) which is given in points.
+ and it returns a :class:`Path` instance. *posA* and *posB* are
+ tuples of x,y coordinates of the two points to be
+ connected. *patchA* (or *patchB*) is given, the returned path is
+ clipped so that it start (or end) from the boundary of the
+ patch. The path is further shrunk by *shrinkA* (or *shrinkB*)
+ which is given in points.
+
"""
_style_list = {}
@@ -2547,18 +2546,18 @@
arrowstyle classes, which is used to create an arrow path along a
given path. These are mainly used with :class:`FancyArrowPatch`.
- A arrowstyle object can be either created as
+ A arrowstyle object can be either created as::
ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)
- or
+ or::
ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)
- or
+ or::
ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")
- Following classes are defined
+ The following classes are defined
%(AvailableArrowstyles)s
@@ -3232,7 +3231,7 @@
connected. It can be an instance of the ConnectionStyle class
(matplotlib.patches.ConnectionStlye) or a string of the
connectionstyle name, with optional comma-separated
- attributes. Following connection styles are available.
+ attributes. The following connection styles are available.
%(AvailableConnectorstyles)s
@@ -3241,7 +3240,7 @@
drawn. It can be string of the available arrowstyle names,
with optional comma-separated attributes, or one of the
ArrowStyle instance. The optional attributes are meant to be
- scaled with the *mutation_scale*. Following arrow styles are
+ scaled with the *mutation_scale*. The following arrow styles are
available.
%(AvailableArrowstyles)s
@@ -3334,14 +3333,12 @@
Old attrs simply are forgotten.
- Without argument (or with connectionstyle=None), it prints out
- available styles.
+ Without argument (or with connectionstyle=None), return
+ available styles as a list of strings.
"""
if connectionstyle==None:
- # print out available styles and return.
- print "Following styles are available:"
- print ConnectionStyle.pprint_styles()
+ return ConnectionStyle.pprint_styles()
if isinstance(connectionstyle, ConnectionStyle._Base):
self._connector = connectionstyle
@@ -3372,14 +3369,12 @@
Old attrs simply are forgotten.
- Without argument (or with arrowstyle=None), it prints out
- available box styles.
+ Without argument (or with arrowstyle=None), return
+ available box styles as a list of strings.
"""
if arrowstyle==None:
- # print out available styles and return.
- print "Following styles are available:"
- print ArrowStyle.pprint_styles()
+ return ArrowStyle.pprint_styles()
if isinstance(arrowstyle, ConnectionStyle._Base):
self._arrow_transmuter = arrowstyle
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-09 03:24:52
|
Revision: 6527
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6527&view=rev
Author: jdh2358
Date: 2008-12-09 03:24:44 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
added more examples to backend driver
Modified Paths:
--------------
trunk/matplotlib/examples/api/watermark_image.py
trunk/matplotlib/examples/api/watermark_text.py
trunk/matplotlib/examples/pylab_examples/annotation_demo.py
trunk/matplotlib/examples/pylab_examples/histogram_demo_extended.py
trunk/matplotlib/examples/pylab_examples/manual_axis.py
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/examples/api/watermark_image.py
===================================================================
--- trunk/matplotlib/examples/api/watermark_image.py 2008-12-08 23:28:55 UTC (rev 6526)
+++ trunk/matplotlib/examples/api/watermark_image.py 2008-12-09 03:24:44 UTC (rev 6527)
@@ -18,5 +18,6 @@
ax.grid()
fig.figimage(im, 10, 10)
-fig.savefig('watermarked', transparent=True)
+#fig.savefig('watermarked', transparent=True)
+plt.show()
Modified: trunk/matplotlib/examples/api/watermark_text.py
===================================================================
--- trunk/matplotlib/examples/api/watermark_text.py 2008-12-08 23:28:55 UTC (rev 6526)
+++ trunk/matplotlib/examples/api/watermark_text.py 2008-12-09 03:24:44 UTC (rev 6527)
@@ -2,8 +2,8 @@
Use a Text as a watermark
"""
import numpy as np
-import matplotlib
-matplotlib.use('Agg')
+#import matplotlib
+#matplotlib.use('Agg')
import matplotlib.pyplot as plt
@@ -18,5 +18,7 @@
fontsize=50, color='gray',
ha='right', va='bottom', alpha=0.5)
-fig.savefig('watermarked_text', transparent=True)
+#fig.savefig('watermarked_text', transparent=True)
+
+plt.show()
Modified: trunk/matplotlib/examples/pylab_examples/annotation_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/annotation_demo.py 2008-12-08 23:28:55 UTC (rev 6526)
+++ trunk/matplotlib/examples/pylab_examples/annotation_demo.py 2008-12-09 03:24:44 UTC (rev 6527)
@@ -82,7 +82,7 @@
horizontalalignment='right', verticalalignment='bottom',
fontsize=20)
- fig.savefig('annotation_coords')
+ #fig.savefig('annotation_coords')
if 1:
# you can specify the xypoint and the xytext in different
@@ -111,7 +111,7 @@
horizontalalignment='left',
verticalalignment='bottom',
)
- fig.savefig('annotation_polar')
+ #fig.savefig('annotation_polar')
if 1:
# You can also use polar notation on a catesian axes. Here the
@@ -138,7 +138,7 @@
ax.set_xlim(-20, 20)
ax.set_ylim(-20, 20)
- fig.savefig('annotation_ellipse')
+ #fig.savefig('annotation_ellipse')
Modified: trunk/matplotlib/examples/pylab_examples/histogram_demo_extended.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/histogram_demo_extended.py 2008-12-08 23:28:55 UTC (rev 6526)
+++ trunk/matplotlib/examples/pylab_examples/histogram_demo_extended.py 2008-12-09 03:24:44 UTC (rev 6527)
@@ -89,5 +89,4 @@
n, bins, patches = P.hist( [x0,x1,x2], 10, histtype='bar')
-
-P.show()
\ No newline at end of file
+P.show()
Modified: trunk/matplotlib/examples/pylab_examples/manual_axis.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/manual_axis.py 2008-12-08 23:28:55 UTC (rev 6526)
+++ trunk/matplotlib/examples/pylab_examples/manual_axis.py 2008-12-09 03:24:44 UTC (rev 6527)
@@ -52,6 +52,6 @@
ax.set_ylim(-1.5, 1.5)
make_xaxis(ax, 0, offset=0.1, **props)
make_yaxis(ax, 0, offset=5, **props)
-fig.savefig('manual_axis.png', dpi=100, facecolor='white', edgecolor='white')
+#fig.savefig('manual_axis.png', dpi=100, facecolor='white', edgecolor='white')
show()
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-12-08 23:28:55 UTC (rev 6526)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-12-09 03:24:44 UTC (rev 6527)
@@ -25,85 +25,154 @@
pylab_dir = os.path.join('..', 'pylab_examples')
pylab_files = [
+ 'two_scales.py',
+
+ 'accented_text.py',
'alignment_test.py',
+ 'annotation_demo.py',
+ 'annotation_demo.py',
+ 'annotation_demo2.py',
+ 'annotation_demo2.py',
+ 'anscombe.py',
'arctest.py',
'arrow_demo.py',
- #'auto_layout.py',
'axes_demo.py',
+ 'axes_props.py',
'axhspan_demo.py',
+ 'axis_equal_demo.py',
'bar_stacked.py',
+ 'barb_demo.py',
'barchart_demo.py',
- 'barb_demo.py',
'barcode_demo.py',
+ 'barh_demo.py',
'boxplot_demo.py',
'broken_barh.py',
- 'barh_demo.py',
+ 'clippedline.py',
+ 'cohere_demo.py',
+ 'color_by_yvalue.py',
'color_demo.py',
- 'cohere_demo.py',
+ 'colorbar_tick_labelling_demo.py',
'contour_demo.py',
+ 'contour_image.py',
'contour_label_demo.py',
'contourf_demo.py',
+ 'contourf_log.py',
+ 'coords_demo.py',
+ 'coords_report.py',
+ 'csd_demo.py',
+ 'cursor_demo.py',
'custom_cmap.py',
- 'geo_demo.py',
- 'griddata_demo.py',
- 'csd_demo.py',
+ 'custom_figure_class.py',
'custom_ticker1.py',
'customize_rc.py',
+ 'dash_control.py',
+ 'dashpointlabel.py',
'date_demo1.py',
'date_demo2.py',
+ 'date_demo_convert.py',
+ 'date_demo_rrule.py',
+ 'date_index_formatter.py',
+ 'dolphin.py',
'ellipse_collection.py',
+ 'ellipse_demo.py',
+ 'ellipse_rotated.py',
'equal_aspect_ratio.py',
+ 'errorbar_demo.py',
'errorbar_limits.py',
+ 'fancyarrow_demo.py',
'fancybox_demo.py',
+ 'fancybox_demo2.py',
'fancytextbox_demo.py',
'figimage_demo.py',
'figlegend_demo.py',
'figure_title.py',
+ 'fill_between.py',
'fill_demo.py',
+ 'fill_demo2.py',
+ 'fill_spiral.py',
'finance_demo.py',
+ 'findobj_demo.py',
+ 'fonts_demo.py',
'fonts_demo_kw.py',
+ 'ganged_plots.py',
+ 'geo_demo.py',
+ 'gradient_bar.py',
+ 'griddata_demo.py',
+ 'hatch_demo.py',
'hexbin_demo.py',
'hexbin_demo2.py',
+ 'hist_colormapped.py',
'histogram_demo.py',
+ 'histogram_demo_extended.py',
'hline_demo.py',
+
+ 'image_clip_path.py',
'image_demo.py',
'image_demo2.py',
+ 'image_demo3.py',
+ 'image_interp.py',
'image_masked.py',
+ 'image_nonuniform.py',
'image_origin.py',
- 'image_nonuniform.py',
+ 'image_slices_viewer.py',
+ 'integral_demo.py',
+ 'interp_demo.py',
'invert_axes.py',
'layer_images.py',
'legend_auto.py',
'legend_demo.py',
'legend_demo2.py',
+ 'legend_demo3.py',
+ 'legend_demo3.py',
+ 'legend_scatter.py',
'line_collection.py',
'line_collection2.py',
'line_styles.py',
+ 'log_bar.py',
'log_demo.py',
'log_test.py',
'major_minor_demo1.py',
'major_minor_demo2.py',
+ 'manual_axis.py',
'masked_demo.py',
'mathtext_demo.py',
+ 'mathtext_examples.py',
+ 'matplotlib_icon.py',
+ 'matshow.py',
+ 'mri_demo.py',
'mri_with_eeg.py',
+ 'multi_image.py',
+ 'multiline.py',
'multiple_figs_demo.py',
- 'multi_image.py',
'nan_test.py',
+ 'newscalarformatter_demo.py',
'pcolor_demo.py',
'pcolor_demo2.py',
+ 'pcolor_log.py',
'pcolor_small.py',
'pie_demo.py',
+ 'plotfile_demo.py',
+ 'polar_bar.py',
'polar_demo.py',
+ 'polar_legend.py',
'polar_scatter.py',
+ 'poormans_contour.py',
'psd_demo.py',
+ 'psd_demo2.py',
+ 'psd_demo3.py',
'quadmesh_demo.py',
'quiver_demo.py',
+ 'scatter_custom_symbol.py',
'scatter_demo.py',
'scatter_demo2.py',
+ 'scatter_masked.py',
+ 'scatter_profile.py',
'scatter_star_poly.py',
+ 'set_and_get.py',
+ 'shared_axis_across_figures.py',
'shared_axis_demo.py',
- 'shared_axis_across_figures.py',
'simple_plot.py',
+ 'simplification_clipping_test.py',
'specgram_demo.py',
'spy_demos.py',
'stem_plot.py',
@@ -111,23 +180,48 @@
'stix_fonts_demo.py',
'stock_demo.py',
'subplot_demo.py',
+ 'subplots_adjust.py',
'symlog_demo.py',
- # 'set_and_get.py',
'table_demo.py',
'text_handles.py',
'text_rotation.py',
+ 'text_rotation_relative_to_line.py',
'text_themes.py',
-# 'tex_demo.py',
-# 'two_scales.py',
+ 'transoffset.py',
'unicode_demo.py',
+ 'vertical_ticklabels.py',
'vline_demo.py',
+ 'webapp_demo.py',
'xcorr_demo.py',
'zorder_demo.py',
+
]
api_dir = os.path.join('..', 'api')
api_files = [
+ 'agg_oo.py',
+ 'barchart_demo.py',
+ 'collections_demo.py',
+ 'custom_projection_example.py',
+ 'custom_scale_example.py',
+ 'date_demo.py',
+ 'date_index_formatter.py',
+ 'font_family_rc.py',
+ 'font_file.py',
+ 'histogram_demo.py',
+ 'image_zcoord.py',
+ 'legend_demo.py',
+ 'line_with_text.py',
+ 'logo2.py',
+ 'mathtext_asarray.py',
+ 'patch_collection.py',
+ 'scatter_piecharts.py',
+ 'span_regions.py',
+ 'unicode_minus.py',
+ 'watermark_image.py',
+ 'watermark_text.py',
+
'bbox_intersect.py',
'colorbar_only.py',
'color_cycle.py',
@@ -178,17 +272,23 @@
report_missing(api_dir, api_files)
report_missing(units_dir, units_files)
-files = [os.path.join(pylab_dir, fname) for fname in pylab_files] +\
- [os.path.join(api_dir, fname) for fname in api_files] +\
+files = (
+ [os.path.join(api_dir, fname) for fname in api_files] +
+ [os.path.join(pylab_dir, fname) for fname in pylab_files] +
[os.path.join(units_dir, fname) for fname in units_files]
+ )
# tests known to fail on a given backend
failbackend = dict(
- SVG = ('tex_demo.py,'),
+ svg = ('tex_demo.py', ),
+ agg = ('hyperlinks.py', ),
+ pdf = ('hyperlinks.py', ),
+ ps = ('hyperlinks.py', ),
)
+
try:
import subprocess
def run(arglist):
@@ -256,7 +356,7 @@
if backend in rcsetup.interactive_bk:
tmpfile.write('show()')
else:
- tmpfile.write('savefig("%s", dpi=150)' % outfile)
+ tmpfile.write('\nsavefig("%s", dpi=150)' % outfile)
tmpfile.close()
start_time = time.time()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-08 23:29:06
|
Revision: 6526
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6526&view=rev
Author: jdh2358
Date: 2008-12-08 23:28:55 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
add support for docstring.hardcopy to format the docstrings less verbosesly for interactive use
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/doc/matplotlibrc
trunk/matplotlib/lib/matplotlib/artist.py
trunk/matplotlib/lib/matplotlib/rcsetup.py
trunk/matplotlib/matplotlibrc.template
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-08 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/CHANGELOG 2008-12-08 23:28:55 UTC (rev 6526)
@@ -1,3 +1,13 @@
+2008-12-08 Some of the changes Michael made to improve the output of
+ the property tables in the rest docs broke of made
+ difficult to use some of the interactive doc helpers, eg
+ setp and getp. Having all the rest markup in the ipython
+ shell also confused the docstrings. I added a new rc param
+ docstring.harcopy, to format the docstrings differently for
+ hardcopy and other use. Ther ArtistInspector could use a
+ little refactoring now since there is duplication of effort
+ between the rest out put and the non-rest output - JDH
+
2008-12-08 Updated spectral methods (psd, csd, etc.) to scale one-sided
densities by a factor of 2 and, optionally, scale all densities
by the sampling frequency. This gives better MatLab
Modified: trunk/matplotlib/doc/matplotlibrc
===================================================================
--- trunk/matplotlib/doc/matplotlibrc 2008-12-08 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/doc/matplotlibrc 2008-12-08 23:28:55 UTC (rev 6526)
@@ -294,6 +294,9 @@
#svg.image_noscale : False # suppress scaling of raster data embedded in SVG
#svg.embed_chars : True # embed character outlines in the SVG file
+# docstring params
+docstring.hardcopy = True # set this when you want to generate hardcopy docstring
+
# Set the verbose flags. This controls how much information
# matplotlib gives you at runtime and where it goes. The verbosity
# levels are: silent, helpful, debug, debug-annoying. Any level is
@@ -311,5 +314,6 @@
#
# You can access the verbose instance in your code
# from matplotlib import verbose.
+
#verbose.level : silent # one of silent, helpful, debug, debug-annoying
#verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr
Modified: trunk/matplotlib/lib/matplotlib/artist.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/artist.py 2008-12-08 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/lib/matplotlib/artist.py 2008-12-08 23:28:55 UTC (rev 6526)
@@ -1,5 +1,6 @@
from __future__ import division
import re, warnings
+import matplotlib
import matplotlib.cbook as cbook
from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
from path import Path
@@ -640,9 +641,12 @@
type) and it is your responsibility to make sure this is so.
"""
if cbook.iterable(o) and len(o): o = o[0]
+
+ self.oorig = o
if not isinstance(o, type):
o = type(o)
self.o = o
+
self.aliasd = self.get_aliases()
def get_aliases(self):
@@ -735,7 +739,7 @@
if ds is None: return False
return ds.startswith('alias for ')
- def aliased_name(self, s, target):
+ def aliased_name(self, s):
"""
return 'PROPNAME or alias' if *s* has an alias, else return
PROPNAME.
@@ -746,11 +750,28 @@
"""
if s in self.aliasd:
+ return s + ''.join([' or %s' % x for x in self.aliasd[s].keys()])
+ else:
+ return s
+
+
+ def aliased_name_rest(self, s, target):
+ """
+ return 'PROPNAME or alias' if *s* has an alias, else return
+ PROPNAME formatted for ReST
+
+ E.g. for the line markerfacecolor property, which has an
+ alias, return 'markerfacecolor or mfc' and for the transform
+ property, which does not, return 'transform'
+ """
+
+ if s in self.aliasd:
aliases = ''.join([' or %s' % x for x in self.aliasd[s].keys()])
else:
aliases = ''
return ':meth:`%s <%s>`%s' % (s, target, aliases)
+
def pprint_setters(self, prop=None, leadingspace=2):
"""
If *prop* is *None*, return a list of strings of all settable properies
@@ -772,8 +793,36 @@
attrs.sort()
lines = []
+ for prop, path in attrs:
+ accepts = self.get_valid_values(prop)
+ name = self.aliased_name(prop)
+
+ lines.append('%s%s: %s' %(pad, name, accepts))
+ return lines
+
+ def pprint_setters_rest(self, prop=None, leadingspace=2):
+ """
+ If *prop* is *None*, return a list of strings of all settable properies
+ and their valid values. Format the output for ReST
+
+ If *prop* is not *None*, it is a valid property name and that
+ property will be returned as a string of property : valid
+ values.
+ """
+ if leadingspace:
+ pad = ' '*leadingspace
+ else:
+ pad = ''
+ if prop is not None:
+ accepts = self.get_valid_values(prop)
+ return '%s%s: %s' %(pad, prop, accepts)
+
+ attrs = self._get_setters_and_targets()
+ attrs.sort()
+ lines = []
+
########
- names = [self.aliased_name(prop, target) for prop, target in attrs]
+ names = [self.aliased_name_rest(prop, target) for prop, target in attrs]
accepts = [self.get_valid_values(prop) for prop, target in attrs]
col0_len = max([len(n) for n in names])
@@ -796,7 +845,7 @@
for prop, path in attrs:
accepts = self.get_valid_values(prop)
- name = self.aliased_name(prop, path)
+ name = self.aliased_name_rest(prop, path)
lines.append('%s%s: %s' %(pad, name, accepts))
return lines
@@ -805,20 +854,27 @@
"""
Return the getters and actual values as list of strings.
"""
- getters = [name for name in dir(self.o)
+
+ o = self.oorig
+ getters = [name for name in dir(o)
if name.startswith('get_')
- and callable(getattr(self.o, name))]
+ and callable(getattr(o, name))]
+ #print getters
getters.sort()
lines = []
for name in getters:
- func = getattr(self.o, name)
+ func = getattr(o, name)
if self.is_alias(func): continue
+
try: val = func()
except: continue
if getattr(val, 'shape', ()) != () and len(val)>6:
s = str(val[:6]) + '...'
else:
s = str(val)
+ s = s.replace('\n', ' ')
+ if len(s)>50:
+ s = s[:50] + '...'
name = self.aliased_name(name[4:])
lines.append(' %s = %s' %(name, s))
return lines
@@ -898,17 +954,17 @@
insp = ArtistInspector(o)
if property is None:
- print '\n'.join(insp.pprint_getters())
+ ret = insp.pprint_getters()
+ print '\n'.join(ret)
return
func = getattr(o, 'get_' + property)
+
return func()
-def get(o, *args, **kwargs):
- return getp(o, *args, **kwargs)
-get.__doc__ = getp.__doc__
+# alias
+get = getp
-
def setp(h, *args, **kwargs):
"""
matplotlib supports the use of :func:`setp` ("set property") and
@@ -984,7 +1040,11 @@
return [x for x in cbook.flatten(ret)]
def kwdoc(a):
- return '\n'.join(ArtistInspector(a).pprint_setters(leadingspace=2))
+ hardcopy = matplotlib.rcParams['docstring.hardcopy']
+ if hardcopy:
+ return '\n'.join(ArtistInspector(a).pprint_setters_rest(leadingspace=2))
+ else:
+ return '\n'.join(ArtistInspector(a).pprint_setters(leadingspace=2))
kwdocd = dict()
kwdocd['Artist'] = kwdoc(Artist)
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-08 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-08 23:28:55 UTC (rev 6526)
@@ -511,6 +511,8 @@
'svg.image_inline' : [True, validate_bool], # write raster image data directly into the svg file
'svg.image_noscale' : [False, validate_bool], # suppress scaling of raster data embedded in SVG
'svg.embed_char_paths' : [True, validate_bool], # True to save all characters as paths in the SVG
+
+ 'docstring.hardcopy' : [False, validate_bool], # set this when you want to generate hardcopy docstring
'plugins.directory' : ['.matplotlib_plugins', str], # where plugin directory is locate
'path.simplify' : [False, validate_bool],
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template 2008-12-08 23:27:08 UTC (rev 6525)
+++ trunk/matplotlib/matplotlibrc.template 2008-12-08 23:28:55 UTC (rev 6526)
@@ -323,6 +323,9 @@
#svg.image_noscale : False # suppress scaling of raster data embedded in SVG
#svg.embed_char_paths : True # embed character outlines in the SVG file
+# docstring params
+#docstring.hardcopy = False # set this when you want to generate hardcopy docstring
+
# Set the verbose flags. This controls how much information
# matplotlib gives you at runtime and where it goes. The verbosity
# levels are: silent, helpful, debug, debug-annoying. Any level is
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-08 23:27:18
|
Revision: 6525
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6525&view=rev
Author: jdh2358
Date: 2008-12-08 23:27:08 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
removed dashtick
Removed Paths:
-------------
trunk/matplotlib/examples/pylab_examples/dashtick.py
Deleted: trunk/matplotlib/examples/pylab_examples/dashtick.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/dashtick.py 2008-12-08 22:04:15 UTC (rev 6524)
+++ trunk/matplotlib/examples/pylab_examples/dashtick.py 2008-12-08 23:27:08 UTC (rev 6525)
@@ -1,61 +0,0 @@
-# Matplotlib xaxis label tweak
-# -*- noplot -*-
-
-import sys
-import matplotlib
-from matplotlib import pylab, ticker
-
-ROTATION=75
-DASHROTATION=75
-DASHBASE=10
-DASHLEN=35
-DASHSTAGGER=3
-FONTSIZE=6
-
-def dashlen(step):
- return DASHBASE+(DASHLEN*(step%DASHSTAGGER))
-
-def test_dashticklabel():
- pylab.clf()
- x = [0.0, 1.0, 1.1, 5.0, 5.1, 6.0]
- y = [1, 3, 2, 5, 1, 2]
- labels = ['foo', 'bar', 'baz', 'alpha', 'beta', 'gamma']
- locator = ticker.FixedLocator(x)
- formatter = ticker.FixedFormatter(labels)
- axis = pylab.axes([0.3, 0.3, 0.4, 0.4])
- axis.xaxis.set_major_locator(locator)
- axis.xaxis.set_major_formatter(formatter)
- axis.yaxis.set_major_locator(locator)
- axis.yaxis.set_major_formatter(formatter)
- for tick in axis.xaxis.get_major_ticks():
- tick.label2On = True
- for tick in axis.yaxis.get_major_ticks():
- tick.label2On = True
- step = 0
- for label in axis.get_xticklabels():
- pylab.setp(label,
- rotation=ROTATION,
- dashlength=dashlen(step),
- dashrotation=DASHROTATION,
- fontsize=FONTSIZE,
- )
- step += 1
- step = 0
- for label in axis.get_yticklabels():
- pylab.setp(label,
- rotation=90-ROTATION,
- dashlength=dashlen(step),
- dashrotation=90-DASHROTATION,
- fontsize=FONTSIZE,
- )
- step += 1
- pylab.xlabel('X Label')
- pylab.ylabel('Y Label')
- pylab.plot(x, y)
- axis.set_xlim((0.0, 6.0))
- axis.set_ylim((0.0, 6.0))
- pylab.savefig('dashticklabel')
- pylab.show()
-
-if __name__ == '__main__':
- test_dashticklabel()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-08 22:04:19
|
Revision: 6524
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6524&view=rev
Author: jdh2358
Date: 2008-12-08 22:04:15 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
fixed some doc formatting errors
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-12-08 21:59:25 UTC (rev 6523)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-12-08 22:04:15 UTC (rev 6524)
@@ -1429,11 +1429,12 @@
args = None
if args is None:
- argstr = 'None' # empy table entry crashed latex build
+ argstr = 'None'
else:
argstr = ",".join([("%s=%s" % (an, av)) for an, av in args])
- _table.append([cls.__name__, name, argstr])
+ #adding quotes for now to work around tex bug treating '-' as itemize
+ _table.append([cls.__name__, "'%s'"%name, argstr])
return _pprint_table(_table)
@@ -3309,13 +3310,13 @@
def set_patchA(self, patchA):
- """ set the begin patche.
+ """ set the begin patch.
"""
self.patchA = patchA
def set_patchB(self, patchB):
- """ set the begin patche.
+ """ set the begin patch
"""
self.patchB = patchB
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-08 21:59:28
|
Revision: 6523
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6523&view=rev
Author: ryanmay
Date: 2008-12-08 21:59:25 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Replace tabs with spaces.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-08 21:54:22 UTC (rev 6522)
+++ trunk/matplotlib/CHANGELOG 2008-12-08 21:59:25 UTC (rev 6523)
@@ -9,31 +9,31 @@
numpy 1.2 or later. -JJL
2008-12-06 Fixed a bug in svg backend that new_figure_manager()
- ignores keywords arguments such as figsize, etc. -JJL
+ ignores keywords arguments such as figsize, etc. -JJL
-2008-12-05 Fixed a bug that the handlelength of the new legend class
- set too short when numpoints=1 -JJL
+2008-12-05 Fixed a bug that the handlelength of the new legend class
+ set too short when numpoints=1 -JJL
2008-12-04 Added support for data with units (e.g. dates) to
Axes.fill_between. -RM
2008-12-04 Added fancybox keyword to legend. Also applied some changes
- for better look, including baseline adjustment of the
- multiline texts so that it is center aligned. -JJL
+ for better look, including baseline adjustment of the
+ multiline texts so that it is center aligned. -JJL
2008-12-02 The transmuter classes in the patches.py are reorganized as
- subclasses of the Style classes. A few more box and arrow
- styles are added. -JJL
+ subclasses of the Style classes. A few more box and arrow
+ styles are added. -JJL
-2008-12-02 Fixed a bug in the new legend class that didn't allowed
+2008-12-02 Fixed a bug in the new legend class that didn't allowed
a tuple of coordinate vlaues as loc. -JJL
-2008-12-02 Improve checks for external dependencies, using subprocess
+2008-12-02 Improve checks for external dependencies, using subprocess
(instead of deprecated popen*) and distutils (for version
checking) - DSD
2008-11-30 Reimplementaion of the legend which supports baseline alignement,
- multi-column, and expand mode. - JJL
+ multi-column, and expand mode. - JJL
2008-12-01 Fixed histogram autoscaling bug when bins or range are given
explicitly (fixes Debian bug 503148) - MM
@@ -187,16 +187,16 @@
2008-07-31 Added masked array support to griddata. - JSW
2008-07-26 Added optional C and reduce_C_function arguments to
- axes.hexbin(). This allows hexbin to accumulate the values
- of C based on the x,y coordinates and display in hexagonal
- bins. - ADS
+ axes.hexbin(). This allows hexbin to accumulate the values
+ of C based on the x,y coordinates and display in hexagonal
+ bins. - ADS
2008-07-24 Deprecated (raise NotImplementedError) all the mlab2
functions from matplotlib.mlab out of concern that some of
them were not clean room implementations. JDH
2008-07-24 Rewrite of a significant portion of the clabel code (class
- ContourLabeler) to improve inlining. - DMK
+ ContourLabeler) to improve inlining. - DMK
2008-07-22 Added Barbs polygon collection (similar to Quiver) for plotting
wind barbs. Added corresponding helpers to Axes and pyplot as
@@ -684,8 +684,8 @@
2007-11-27 Released 0.91.0 at revision 4478
2007-11-13 All backends now support writing to a file-like object, not
- just a regular file. savefig() can be passed a file-like
- object in place of a file path. - MGD
+ just a regular file. savefig() can be passed a file-like
+ object in place of a file path. - MGD
2007-11-13 Improved the default backend selection at build time:
SVG -> Agg -> TkAgg -> WXAgg -> GTK -> GTKAgg. The last usable
@@ -703,24 +703,24 @@
updated on subsequent installs - DSD
2007-11-12 Added support for STIX fonts. A new rcParam,
- mathtext.fontset, can be used to choose between:
+ mathtext.fontset, can be used to choose between:
- 'cm':
- The TeX/LaTeX Computer Modern fonts
+ 'cm':
+ The TeX/LaTeX Computer Modern fonts
- 'stix':
- The STIX fonts (see stixfonts.org)
+ 'stix':
+ The STIX fonts (see stixfonts.org)
- 'stixsans':
- The STIX fonts, using sans-serif glyphs by default
+ 'stixsans':
+ The STIX fonts, using sans-serif glyphs by default
- 'custom':
- A generic Unicode font, in which case the mathtext font
- must be specified using mathtext.bf, mathtext.it,
- mathtext.sf etc.
+ 'custom':
+ A generic Unicode font, in which case the mathtext font
+ must be specified using mathtext.bf, mathtext.it,
+ mathtext.sf etc.
- Added a new example, stix_fonts_demo.py to show how to access
- different fonts and unusual symbols.
+ Added a new example, stix_fonts_demo.py to show how to access
+ different fonts and unusual symbols.
- MGD
@@ -771,72 +771,72 @@
2007-10-29 TRANSFORMS REFACTORING
- The primary goal of this refactoring was to make it easier
- to extend matplotlib to support new kinds of projections.
- This is primarily an internal improvement, and the possible
- user-visible changes it allows are yet to come.
+ The primary goal of this refactoring was to make it easier
+ to extend matplotlib to support new kinds of projections.
+ This is primarily an internal improvement, and the possible
+ user-visible changes it allows are yet to come.
- The transformation framework was completely rewritten in
- Python (with Numpy). This will make it easier to add news
- kinds of transformations without writing C/C++ code.
+ The transformation framework was completely rewritten in
+ Python (with Numpy). This will make it easier to add news
+ kinds of transformations without writing C/C++ code.
- Transforms are composed into a 'transform tree', made of
- transforms whose value depends on other transforms (their
- children). When the contents of children change, their
- parents are automatically updated to reflect those changes.
- To do this an "invalidation" method is used: when children
- change, all of their ancestors are marked as "invalid".
- When the value of a transform is accessed at a later time,
- its value is recomputed only if it is invalid, otherwise a
- cached value may be used. This prevents unnecessary
- recomputations of transforms, and contributes to better
- interactive performance.
+ Transforms are composed into a 'transform tree', made of
+ transforms whose value depends on other transforms (their
+ children). When the contents of children change, their
+ parents are automatically updated to reflect those changes.
+ To do this an "invalidation" method is used: when children
+ change, all of their ancestors are marked as "invalid".
+ When the value of a transform is accessed at a later time,
+ its value is recomputed only if it is invalid, otherwise a
+ cached value may be used. This prevents unnecessary
+ recomputations of transforms, and contributes to better
+ interactive performance.
- The framework can be used for both affine and non-affine
- transformations. However, for speed, we want use the
- backend renderers to perform affine transformations
- whenever possible. Therefore, it is possible to perform
- just the affine or non-affine part of a transformation on a
- set of data. The affine is always assumed to occur after
- the non-affine. For any transform:
+ The framework can be used for both affine and non-affine
+ transformations. However, for speed, we want use the
+ backend renderers to perform affine transformations
+ whenever possible. Therefore, it is possible to perform
+ just the affine or non-affine part of a transformation on a
+ set of data. The affine is always assumed to occur after
+ the non-affine. For any transform:
- full transform == non-affine + affine
+ full transform == non-affine + affine
- Much of the drawing has been refactored in terms of
- compound paths. Therefore, many methods have been removed
- from the backend interface and replaced with a a handful to
- draw compound paths. This will make updating the backends
- easier, since there is less to update. It also should make
- the backends more consistent in terms of functionality.
+ Much of the drawing has been refactored in terms of
+ compound paths. Therefore, many methods have been removed
+ from the backend interface and replaced with a a handful to
+ draw compound paths. This will make updating the backends
+ easier, since there is less to update. It also should make
+ the backends more consistent in terms of functionality.
- User visible changes:
+ User visible changes:
- - POLAR PLOTS: Polar plots are now interactively zoomable,
+ - POLAR PLOTS: Polar plots are now interactively zoomable,
and the r-axis labels can be interactively rotated.
Straight line segments are now interpolated to follow the
curve of the r-axis.
- - Non-rectangular clipping works in more backends and with
+ - Non-rectangular clipping works in more backends and with
more types of objects.
- - Sharing an axis across figures is now done in exactly
- the same way as sharing an axis between two axes in the
- same figure:
+ - Sharing an axis across figures is now done in exactly
+ the same way as sharing an axis between two axes in the
+ same figure:
- fig1 = figure()
- fig2 = figure()
+ fig1 = figure()
+ fig2 = figure()
- ax1 = fig1.add_subplot(111)
- ax2 = fig2.add_subplot(111, sharex=ax1, sharey=ax1)
+ ax1 = fig1.add_subplot(111)
+ ax2 = fig2.add_subplot(111, sharex=ax1, sharey=ax1)
- linestyles now include steps-pre, steps-post and
steps-mid. The old step still works and is equivalent to
step-pre.
- - Multiple line styles may be provided to a collection.
+ - Multiple line styles may be provided to a collection.
- See API_CHANGES for more low-level information about this
- refactoring.
+ See API_CHANGES for more low-level information about this
+ refactoring.
2007-10-24 Added ax kwarg to Figure.colorbar and pyplot.colorbar - EF
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-08 21:54:54
|
Revision: 6522
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6522&view=rev
Author: jdh2358
Date: 2008-12-08 21:54:22 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
fixed some doc formatting errors
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/legend.py
trunk/matplotlib/lib/matplotlib/patches.py
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-08 21:27:40 UTC (rev 6521)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-08 21:54:22 UTC (rev 6522)
@@ -123,10 +123,9 @@
Optional keyword arguments:
- ================ =================================================
+ ================ ==================================================================
Keyword Description
- ================ =================================================
-
+ ================ ==================================================================
loc a location code or a tuple of coordinates
numpoints the number of points in the legend line
prop the font property
@@ -134,17 +133,16 @@
fancybox if True, draw a frame with a round fancybox. If None, use rc
shadow if True, draw a shadow behind legend
scatteryoffsets a list of yoffsets for scatter symbols in legend
-
borderpad the fractional whitespace inside the legend border
labelspacing the vertical space between the legend entries
handlelength the length of the legend handles
handletextpad the pad between the legend handle and text
borderaxespad the pad between the axes and legend border
columnspacing the spacing between columns
+ ================ ==================================================================
The dimensions of pad and spacing are given as a fraction of the
fontsize. Values from rcParams will be used if None.
-
"""
from matplotlib.axes import Axes # local import only to avoid circularity
from matplotlib.figure import Figure # local import only to avoid circularity
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-12-08 21:27:40 UTC (rev 6521)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-12-08 21:54:22 UTC (rev 6522)
@@ -1426,11 +1426,16 @@
args = [(argname, argdefault) \
for argname, argdefault in zip(args[1:], defaults)]
else:
- args = []
+ args = None
- _table.append([cls.__name__, name,
- ",".join([("%s=%s" % (an, av)) for an, av in args])])
+ if args is None:
+ argstr = 'None' # empy table entry crashed latex build
+ else:
+ argstr = ",".join([("%s=%s" % (an, av)) for an, av in args])
+ _table.append([cls.__name__, name, argstr])
+
+
return _pprint_table(_table)
@@ -2015,8 +2020,8 @@
comma-separated attributes. Alternatively, the attrs can
be provided as keywords::
- set_boxstyle("round,pad=0.2")
- set_boxstyle("round", pad=0.2)
+ set_boxstyle("round,pad=0.2")
+ set_boxstyle("round", pad=0.2)
Old attrs simply are forgotten.
@@ -2024,6 +2029,7 @@
available box styles.
ACCEPTS: [ %(AvailableBoxstyles)s ]
+
"""
if boxstyle==None:
@@ -2793,6 +2799,7 @@
_style_list["-"] = Curve
+
class CurveA(_Curve):
"""
An arrow with a head at its begin point.
@@ -2813,7 +2820,6 @@
_style_list["<-"] = CurveA
-
class CurveB(_Curve):
"""
An arrow with a head at its end point.
@@ -2832,6 +2838,7 @@
beginarrow=False, endarrow=True,
head_length=head_length, head_width=head_width )
+ #_style_list["->"] = CurveB
_style_list["->"] = CurveB
@@ -2853,6 +2860,7 @@
beginarrow=True, endarrow=True,
head_length=head_length, head_width=head_width )
+ #_style_list["<->"] = CurveAB
_style_list["<->"] = CurveAB
@@ -2960,6 +2968,7 @@
super(ArrowStyle.BracketB, self).__init__(None, True,
widthB=widthB, lengthB=lengthB, angleB=None )
+ #_style_list["-["] = BracketB
_style_list["-["] = BracketB
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-12-08 21:27:40 UTC (rev 6521)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-12-08 21:54:22 UTC (rev 6522)
@@ -1297,9 +1297,9 @@
drawn. Valid keys for YAArow are
- ========= ===========================================================
+ ========= =============================================================
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
@@ -1310,7 +1310,7 @@
and base are shink percent of the distance *d* away from the
endpoints. ie, ``shrink=0.05 is 5%%``
? any key for :class:`matplotlib.patches.polygon`
- ========= ===========================================================
+ ========= =============================================================
Valid keys for FancyArrowPatch are
@@ -1319,8 +1319,8 @@
=============== ======================================================
Key Description
=============== ======================================================
- arrowstyle
- connectionstyle
+ arrowstyle the arrow style
+ connectionstyle the connection style
relpos default is (0.5, 0.5)
patchA default is bounding box of the text
patchB default is None
@@ -1328,8 +1328,8 @@
shrinkB default is 2 points
mutation_scale default is text size (in points)
mutation_aspect default is 1.
- ? any key for :class:`matplotlib.patches.PathPatch`
- ========= ===========================================================
+ ? any key for :class:`matplotlib.patches.PathPatch`
+ =============== ======================================================
*xycoords* and *textcoords* are strings that indicate the
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-08 21:27:44
|
Revision: 6521
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6521&view=rev
Author: ryanmay
Date: 2008-12-08 21:27:40 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Remove trailing whitespace.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-08 21:23:04 UTC (rev 6520)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-08 21:27:40 UTC (rev 6521)
@@ -6521,7 +6521,7 @@
if not self._hold: self.cla()
# NOTE: the range keyword overwrites the built-in func range !!!
- # needs to be fixed in with numpy !!!
+ # needs to be fixed in with numpy !!!
if kwargs.get('width') is not None:
raise DeprecationWarning(
@@ -6551,7 +6551,7 @@
binsgiven = (cbook.iterable(bins) or range != None)
# check the version of the numpy
- if np.__version__ < "1.2": # version 1.1
+ if np.__version__ < "1.2": # version 1.1
hist_kwargs = dict(range=range,
normed=bool(normed), new=True)
else: # version 1.2 and later, drop new=True
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-08 21:23:09
|
Revision: 6520
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6520&view=rev
Author: ryanmay
Date: 2008-12-08 21:23:04 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Update CHANGELOG and api_changes for the changes to psd and friends.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/doc/api/api_changes.rst
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-08 21:16:04 UTC (rev 6519)
+++ trunk/matplotlib/CHANGELOG 2008-12-08 21:23:04 UTC (rev 6520)
@@ -1,3 +1,8 @@
+2008-12-08 Updated spectral methods (psd, csd, etc.) to scale one-sided
+ densities by a factor of 2 and, optionally, scale all densities
+ by the sampling frequency. This gives better MatLab
+ compatibility. -RM
+
2008-12-08 Fixed alignment of ticks in colorbars. -MGD
2008-12-07 drop the deprecated "new" keyword of np.histogram() for
Modified: trunk/matplotlib/doc/api/api_changes.rst
===================================================================
--- trunk/matplotlib/doc/api/api_changes.rst 2008-12-08 21:16:04 UTC (rev 6519)
+++ trunk/matplotlib/doc/api/api_changes.rst 2008-12-08 21:23:04 UTC (rev 6520)
@@ -9,6 +9,15 @@
Changes for 0.98.x
==================
+* Modified :func:`matplotlib.mlab.psd`, :func:`matplotlib.mlab.csd`,
+ :func:`matplotlib.mlab.cohere`, and :func:`matplotlib.mlab.specgram`
+ to scale one-sided densities by a factor of 2. Also, optionally
+ scale the densities by the sampling frequency, which gives true values
+ of densities that can be integrated by the returned frequency values.
+ This also gives better MatLab compatibility. The corresponding
+ :class:`matplotlib.axes.Axes` methods and :mod:`matplotlib.pyplot`
+ functions were updated as well.
+
* Font lookup now uses a nearest-neighbor approach rather than an
exact match. Some fonts may be different in plots, but should be
closer to what was requested.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-08 21:16:08
|
Revision: 6519
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6519&view=rev
Author: ryanmay
Date: 2008-12-08 21:16:04 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Add a converted MatLab example that was used to figure out the differences between MatLab and matplotlib PSD scaling.
Added Paths:
-----------
trunk/matplotlib/examples/pylab_examples/psd_demo3.py
Added: trunk/matplotlib/examples/pylab_examples/psd_demo3.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/psd_demo3.py (rev 0)
+++ trunk/matplotlib/examples/pylab_examples/psd_demo3.py 2008-12-08 21:16:04 UTC (rev 6519)
@@ -0,0 +1,34 @@
+#This is a ported version of a Matlab example from the signal processing
+#toolbox that showed some difference at one time between Matplotlib's and
+#MatLab's scaling of the PSD.
+
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
+
+fs = 1000
+t = np.linspace(0, 0.3, 301)
+A = np.array([2, 8]).reshape(-1, 1)
+f = np.array([150, 140]).reshape(-1, 1)
+xn = (A * np.sin(2 * np.pi * f * t)).sum(axis=0) + 5 * np.random.randn(*t.shape)
+
+yticks = np.arange(-50, 30, 10)
+xticks = np.arange(0,550,100)
+
+plt.subplot(1,2,1)
+plt.psd(xn, NFFT=301, Fs=fs, window=mlab.window_none, pad_to=1024,
+ scale_by_freq=True)
+plt.title('Periodogram PSD Estimate')
+plt.yticks(yticks)
+plt.xticks(xticks)
+plt.grid(True)
+
+plt.subplot(1,2,2)
+plt.psd(xn, NFFT=150, Fs=fs, window=mlab.window_none, noverlap=75, pad_to=512,
+ scale_by_freq=True)
+plt.title('Welch Method PSD Estimate')
+plt.xticks(xticks)
+plt.yticks(yticks)
+plt.grid(True)
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-08 21:15:23
|
Revision: 6518
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6518&view=rev
Author: ryanmay
Date: 2008-12-08 21:15:13 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Update spectral methods (psd, csd, etc.) to scale one-sided densities by a factor of 2 and, optionally, scale all densities by the sampling frequency. This gives better MatLab compatibility. Update corresponding Axes methods, and make Axes.psd() label the y-axis of the plot as appropriate.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/mlab.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-08 21:06:49 UTC (rev 6517)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-08 21:15:13 UTC (rev 6518)
@@ -6719,13 +6719,13 @@
def psd(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs):
+ sides='default', scale_by_freq=None, **kwargs):
"""
call signature::
psd(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs)
+ sides='default', scale_by_freq=None, **kwargs)
The power spectral density by Welch's average periodogram
method. The vector *x* is divided into *NFFT* length
@@ -6764,13 +6764,18 @@
"""
if not self._hold: self.cla()
pxx, freqs = mlab.psd(x, NFFT, Fs, detrend, window, noverlap, pad_to,
- sides)
+ sides, scale_by_freq)
pxx.shape = len(freqs),
freqs += Fc
+ if scale_by_freq in (None, True):
+ psd_units = 'dB/Hz'
+ else:
+ psd_units = 'dB'
+
self.plot(freqs, 10*np.log10(pxx), **kwargs)
self.set_xlabel('Frequency')
- self.set_ylabel('Power Spectrum (dB)')
+ self.set_ylabel('Power Spectral Density (%s)' % psd_units)
self.grid(True)
vmin, vmax = self.viewLim.intervaly
intv = vmax-vmin
@@ -6791,13 +6796,13 @@
def csd(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs):
+ sides='default', scale_by_freq=None, **kwargs):
"""
call signature::
csd(x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs)
+ sides='default', scale_by_freq=None, **kwargs)
The cross spectral density :math:`P_{xy}` by Welch's average
periodogram method. The vectors *x* and *y* are divided into
@@ -6837,7 +6842,7 @@
"""
if not self._hold: self.cla()
pxy, freqs = mlab.csd(x, y, NFFT, Fs, detrend, window, noverlap,
- pad_to, sides)
+ pad_to, sides, scale_by_freq)
pxy.shape = len(freqs),
# pxy is complex
freqs += Fc
@@ -6859,13 +6864,13 @@
def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs):
+ sides='default', scale_by_freq=None, **kwargs):
"""
call signature::
cohere(x, y, NFFT=256, Fs=2, Fc=0, detrend = mlab.detrend_none,
window = mlab.window_hanning, noverlap=0, pad_to=None,
- sides='default', **kwargs)
+ sides='default', scale_by_freq=None, **kwargs)
cohere the coherence between *x* and *y*. Coherence is the normalized
cross spectral density:
@@ -6902,7 +6907,8 @@
.. plot:: mpl_examples/pylab_examples/cohere_demo.py
"""
if not self._hold: self.cla()
- cxy, freqs = mlab.cohere(x, y, NFFT, Fs, detrend, window, noverlap)
+ cxy, freqs = mlab.cohere(x, y, NFFT, Fs, detrend, window, noverlap,
+ scale_by_freq)
freqs += Fc
self.plot(freqs, cxy, **kwargs)
@@ -6915,13 +6921,15 @@
def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=128,
- cmap=None, xextent=None, pad_to=None, sides='default'):
+ cmap=None, xextent=None, pad_to=None, sides='default',
+ scale_by_freq=None):
"""
call signature::
specgram(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=128,
- cmap=None, xextent=None, pad_to=None, sides='default')
+ cmap=None, xextent=None, pad_to=None, sides='default',
+ scale_by_freq=None)
Compute a spectrogram of data in *x*. Data are split into
*NFFT* length segments and the PSD of each section is
@@ -6965,7 +6973,7 @@
if not self._hold: self.cla()
Pxx, freqs, bins = mlab.specgram(x, NFFT, Fs, detrend,
- window, noverlap, pad_to, sides)
+ window, noverlap, pad_to, sides, scale_by_freq)
Z = 10. * np.log10(Pxx)
Z = np.flipud(Z)
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-12-08 21:06:49 UTC (rev 6517)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-12-08 21:15:13 UTC (rev 6518)
@@ -243,14 +243,15 @@
#This is a helper function that implements the commonality between the
#psd, csd, and spectrogram. It is *NOT* meant to be used outside of mlab
def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=0, pad_to=None, sides='default'):
+ window=window_hanning, noverlap=0, pad_to=None, sides='default',
+ scale_by_freq=None):
#The checks for if y is x are so that we can use the same function to
#implement the core of psd(), csd(), and spectrogram() without doing
#extra calculations. We return the unaveraged Pxy, freqs, and t.
+ same_data = y is x
#Make sure we're dealing with a numpy array. If y and x were the same
#object to start with, keep them that way
- same_data = y is x
x = np.asarray(x)
if not same_data:
@@ -270,15 +271,31 @@
if pad_to is None:
pad_to = NFFT
+ if scale_by_freq is None:
+ warnings.warn("psd, csd, and specgram have changed to scale their "
+ "densities by the sampling frequency for better MatLab "
+ "compatibility. You can pass scale_by_freq=False to disable "
+ "this behavior. Also, one-sided densities are scaled by a "
+ "factor of 2.")
+ scale_by_freq = True
+
# For real x, ignore the negative frequencies unless told otherwise
if (sides == 'default' and np.iscomplexobj(x)) or sides == 'twosided':
numFreqs = pad_to
+ scaling_factor = 1.
elif sides in ('default', 'onesided'):
numFreqs = pad_to//2 + 1
+ scaling_factor = 2.
else:
raise ValueError("sides must be one of: 'default', 'onesided', or "
"'twosided'")
+ # Matlab divides by the sampling frequency so that density function
+ # has units of dB/Hz and can be integrated by the plotted frequency
+ # values. Perform the same scaling here.
+ if scale_by_freq:
+ scaling_factor /= Fs
+
if cbook.iterable(window):
assert(len(window) == NFFT)
windowVals = window
@@ -305,8 +322,10 @@
Pxy[:,i] = np.conjugate(fx[:numFreqs]) * fy[:numFreqs]
# Scale the spectrum by the norm of the window to compensate for
- # windowing loss; see Bendat & Piersol Sec 11.5.2
- Pxy /= (np.abs(windowVals)**2).sum()
+ # windowing loss; see Bendat & Piersol Sec 11.5.2. Also include
+ # scaling factors for one-sided densities and dividing by the sampling
+ # frequency, if desired.
+ Pxy *= scaling_factor / (np.abs(windowVals)**2).sum()
t = 1./Fs * (ind + NFFT / 2.)
freqs = float(Fs) / pad_to * np.arange(numFreqs)
@@ -363,12 +382,18 @@
*sides*: [ 'default' | 'onesided' | 'twosided' ]
Specifies which sides of the PSD to return. Default gives the
default behavior, which returns one-sided for real data and both
- for complex data. 'one' forces the return of a one-sided PSD, while
- 'both' forces two-sided.
+ for complex data. 'onesided' forces the return of a one-sided PSD,
+ while 'twosided' forces two-sided.
+
+ *scale_by_freq*: boolean
+ Specifies whether the resulting density values should be scaled
+ by the scaling frequency, which gives density in units of Hz^-1.
+ This allows for integration over the returned frequency values.
+ The default is True for MatLab compatibility.
"""
-def psd(x, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=0, pad_to=None, sides='default'):
+def psd(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
"""
The power spectral density by Welch's average periodogram method.
The vector *x* is divided into *NFFT* length blocks. Each block
@@ -388,13 +413,14 @@
Bendat & Piersol -- Random Data: Analysis and Measurement
Procedures, John Wiley & Sons (1986)
"""
- Pxx,freqs = csd(x, x, NFFT, Fs, detrend, window, noverlap, pad_to, sides)
+ Pxx,freqs = csd(x, x, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
return Pxx.real,freqs
psd.__doc__ = psd.__doc__ % kwdocd
-def csd(x, y, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=0, pad_to=None, sides='default'):
+def csd(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
"""
The cross power spectral density by Welch's average periodogram
method. The vectors *x* and *y* are divided into *NFFT* length
@@ -417,7 +443,7 @@
Procedures, John Wiley & Sons (1986)
"""
Pxy, freqs, t = _spectral_helper(x, y, NFFT, Fs, detrend, window,
- noverlap, pad_to, sides)
+ noverlap, pad_to, sides, scale_by_freq)
if len(Pxy.shape) == 2 and Pxy.shape[1]>1:
Pxy = Pxy.mean(axis=1)
@@ -425,9 +451,8 @@
csd.__doc__ = csd.__doc__ % kwdocd
-def specgram(x, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=128, pad_to=None,
- sides='default'):
+def specgram(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=128, pad_to=None, sides='default', scale_by_freq=None):
"""
Compute a spectrogram of data in *x*. Data are split into *NFFT*
length segements and the PSD of each section is computed. The
@@ -458,7 +483,7 @@
assert(NFFT > noverlap)
Pxx, freqs, t = _spectral_helper(x, x, NFFT, Fs, detrend, window,
- noverlap, pad_to, sides)
+ noverlap, pad_to, sides, scale_by_freq)
Pxx = Pxx.real #Needed since helper implements generically
if (np.iscomplexobj(x) and sides == 'default') or sides == 'twosided':
@@ -473,8 +498,8 @@
_coh_error = """Coherence is calculated by averaging over *NFFT*
length segments. Your signal is too short for your choice of *NFFT*.
"""
-def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none,
- window=window_hanning, noverlap=0, pad_to=None, sides='default'):
+def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
"""
The coherence between *x* and *y*. Coherence is the normalized
cross spectral density:
@@ -487,7 +512,9 @@
Array or sequence containing the data
%(PSD)s
The return value is the tuple (*Cxy*, *f*), where *f* are the
- frequencies of the coherence vector.
+ frequencies of the coherence vector. For cohere, scaling the
+ individual densities by the sampling frequency has no effect, since
+ the factors cancel out.
.. seealso::
:func:`psd` and :func:`csd`:
@@ -497,9 +524,12 @@
if len(x)<2*NFFT:
raise ValueError(_coh_error)
- Pxx, f = psd(x, NFFT, Fs, detrend, window, noverlap, pad_to, sides)
- Pyy, f = psd(y, NFFT, Fs, detrend, window, noverlap, pad_to, sides)
- Pxy, f = csd(x, y, NFFT, Fs, detrend, window, noverlap, pad_to, sides)
+ Pxx, f = psd(x, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
+ Pyy, f = psd(y, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
+ Pxy, f = csd(x, y, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
Cxy = np.divide(np.absolute(Pxy)**2, Pxx*Pyy)
Cxy.shape = (len(f),)
@@ -3246,4 +3276,3 @@
c2x, c2y = c1x + 1./3. * (q2x - q0x), c1y + 1./3. * (q2y - q0y)
# c3x, c3y = q2x, q2y
return q0x, q0y, c1x, c1y, c2x, c2y, q2x, q2y
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-08 21:06:52
|
Revision: 6517
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6517&view=rev
Author: jdh2358
Date: 2008-12-08 21:06:49 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
fixed inaxes event bug
Modified Paths:
--------------
trunk/matplotlib/doc/_templates/gallery.html
trunk/matplotlib/doc/users/mathtext.rst
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/doc/_templates/gallery.html
===================================================================
--- trunk/matplotlib/doc/_templates/gallery.html 2008-12-08 20:21:33 UTC (rev 6516)
+++ trunk/matplotlib/doc/_templates/gallery.html 2008-12-08 21:06:49 UTC (rev 6517)
@@ -53,6 +53,8 @@
<a href="examples/api/two_scales.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/two_scales.png" border="0" alt="two_scales"/></a>
+<a href="examples/api/unicode_minus.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/unicode_minus.png" border="0" alt="unicode_minus"/></a>
+
<a href="examples/api/watermark_image.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/watermark_image.png" border="0" alt="watermark_image"/></a>
<a href="examples/api/watermark_text.html"><img src="_static/plot_directive/mpl_examples/api/thumbnails/watermark_text.png" border="0" alt="watermark_text"/></a>
@@ -217,8 +219,12 @@
<a href="examples/pylab_examples/errorbar_limits.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/errorbar_limits_01.png" border="0" alt="errorbar_limits"/></a>
+<a href="examples/pylab_examples/fancyarrow_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancyarrow_demo.png" border="0" alt="fancyarrow_demo"/></a>
+
<a href="examples/pylab_examples/fancybox_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancybox_demo.png" border="0" alt="fancybox_demo"/></a>
+<a href="examples/pylab_examples/fancybox_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancybox_demo2.png" border="0" alt="fancybox_demo2"/></a>
+
<a href="examples/pylab_examples/fancytextbox_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/fancytextbox_demo.png" border="0" alt="fancytextbox_demo"/></a>
<a href="examples/pylab_examples/figimage_demo.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/figimage_demo.png" border="0" alt="figimage_demo"/></a>
@@ -333,6 +339,8 @@
<a href="examples/pylab_examples/legend_demo2.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo2.png" border="0" alt="legend_demo2"/></a>
+<a href="examples/pylab_examples/legend_demo3.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_demo3.png" border="0" alt="legend_demo3"/></a>
+
<a href="examples/pylab_examples/legend_scatter.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/legend_scatter.png" border="0" alt="legend_scatter"/></a>
<a href="examples/pylab_examples/line_collection.html"><img src="_static/plot_directive/mpl_examples/pylab_examples/thumbnails/line_collection.png" border="0" alt="line_collection"/></a>
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst 2008-12-08 20:21:33 UTC (rev 6516)
+++ trunk/matplotlib/doc/users/mathtext.rst 2008-12-08 21:06:49 UTC (rev 6517)
@@ -143,8 +143,16 @@
s(t) = \mathcal{A}\sin(2 \omega t)
Here "s" and "t" are variable in italics font (default), "sin" is in
-Roman font, and the amplitude "A" is in calligraphy font.
+Roman font, and the amplitude "A" is in calligraphy font. Note in the
+example above the caligraphy ``A`` is squished into the ``sin``. You
+can use a spacing command to add a little whitespace between them::
+ s(t) = \mathcal{A}\/\sin(2 \omega t)
+
+.. math::
+
+ s(t) = \mathcal{A}\/\sin(2 \omega t)
+
The choices available with all fonts are:
============================ ==================================
@@ -159,7 +167,7 @@
.. role:: math-stix(math)
:fontset: stix
-When using the STIX fonts, you also have the choice of:
+When using the `STIX <http://www.aip.org/stixfonts/>`_ fonts, you also have the choice of:
====================================== =========================================
Command Result
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-12-08 20:21:33 UTC (rev 6516)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-12-08 21:06:49 UTC (rev 6517)
@@ -758,7 +758,7 @@
if x is None or y is None:
# cannot check if event was in axes if no x,y info
- self.inaxes = False
+ self.inaxes = None
self._update_enter_leave()
return
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-12-08 20:21:33 UTC (rev 6516)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-12-08 21:06:49 UTC (rev 6517)
@@ -1382,9 +1382,9 @@
for row in _table:
for column, cell in zip(columns, row):
column.append(cell)
-
-
+
+
col_len = [max([len(cell) for cell in column]) for column in columns]
lines = []
@@ -1394,10 +1394,10 @@
lines.append(table_formatstr)
lines.append(pad + ' '.join([cell.ljust(cl) for cell, cl in zip(_table[0], col_len)]))
lines.append(table_formatstr)
-
+
lines.extend([(pad + ' '.join([cell.ljust(cl) for cell, cl in zip(row, col_len)]))
for row in _table[1:]])
-
+
lines.append(table_formatstr)
lines.append('')
return "\n".join(lines)
@@ -1427,10 +1427,10 @@
for argname, argdefault in zip(args[1:], defaults)]
else:
args = []
-
+
_table.append([cls.__name__, name,
",".join([("%s=%s" % (an, av)) for an, av in args])])
-
+
return _pprint_table(_table)
@@ -1448,7 +1448,7 @@
# the "class" should have the _style_list attribute, which is
# a dictionary of stylname, style class paie.
-
+
_list = stylename.replace(" ","").split(",")
_name = _list[0].lower()
try:
@@ -1492,20 +1492,20 @@
BoxStyle.Round(pad=0.2)
- or
+ or
BoxStyle("Round", pad=0.2)
or
-
+
BoxStyle("Round, pad=0.2")
Following boxstyle classes are defined.
-
+
%(AvailableBoxstyles)s
An instance of any boxstyle class is an callable object,
- whose call signature is
+ whose call signature is::
__call__(self, x0, y0, width, height, mutation_size, aspect_ratio=1.)
@@ -1517,7 +1517,7 @@
the mutation.
"""
-
+
_style_list = {}
@@ -1593,7 +1593,7 @@
*pad*
amount of padding
"""
-
+
self.pad = pad
super(BoxStyle.Square, self).__init__()
@@ -1653,7 +1653,7 @@
dxx = dx*.5
# adjust x0. 1.4 <- sqrt(2)
x0 = x0 + pad / 1.4
-
+
cp = [(x0+dxx, y0), (x1, y0), (x1, y1), (x0+dxx, y1),
(x0+dxx, y1+dxx), (x0-dx, y0+dx), (x0+dxx, y0-dxx), # arrow
(x0+dxx, y0), (x0+dxx, y0)]
@@ -1687,7 +1687,7 @@
return p
-
+
_style_list["rarrow"] = RArrow
@@ -1770,7 +1770,7 @@
*rounding_size*
rounding size of edges. *pad* if None
"""
-
+
self.pad = pad
self.rounding_size = rounding_size
super(BoxStyle.Round4, self).__init__()
@@ -2038,8 +2038,8 @@
self._bbox_transmuter = boxstyle
else:
self._bbox_transmuter = BoxStyle(boxstyle, **kw)
-
+
kwdoc = dict()
kwdoc["AvailableBoxstyles"]=_pprint_styles(BoxStyle._style_list)
kwdoc.update(artist.kwdocd)
@@ -2180,12 +2180,12 @@
ConnectionStyle.Arc3(rad=0.2)
- or
+ or
ConnectionStyle("Arc3", rad=0.2)
or
-
+
ConnectionStyle("Arc3, rad=0.2")
Following classes are defined
@@ -2194,7 +2194,7 @@
An instance of any connection style class is an callable object,
- whose call signature is
+ whose call signature is::
__call__(self, posA, posB, patchA=None, patchB=None, shrinkA=2., shrinkB=2.)
@@ -2204,17 +2204,17 @@
(or end) from the boundary of the patch. The path is further
shrinked by *shrinkA* (or *shrinkB*) which is given in points.
"""
-
+
_style_list = {}
class _Base(object):
"""
A base class for connectionstyle classes. The dervided needs
- to implement a *connect* methods whose call signature is
+ to implement a *connect* methods whose call signature is::
connect(posA, posB)
-
+
where posA and posB are tuples of x, y coordinates to be
connected. The methods needs to return a path connecting two
points. This base class defines a __call__ method, and few
@@ -2289,7 +2289,7 @@
Calls the *connect* method to create a path between *posA*
and *posB*. The path is clipped and shrinked.
"""
-
+
path = self.connect(posA, posB)
clipped_path = self._clip(path, patchA, patchB)
@@ -2334,8 +2334,8 @@
return Path(vertices, codes)
_style_list["arc3"] = Arc3
-
+
class Angle3(_Base):
"""
Creates a simple quadratic bezier curve between two
@@ -2448,16 +2448,16 @@
def __init__(self, angleA=0, angleB=0, armA=None, armB=None, rad=0.):
"""
*angleA* :
- starting angle of the path
+ starting angle of the path
*angleB* :
- ending angle of the path
+ ending angle of the path
*armA* :
- length of the starting arm
+ length of the starting arm
*armB* :
- length of the ending arm
+ length of the ending arm
*rad* :
rounding radius of the edges
@@ -2531,9 +2531,9 @@
__doc__ = cbook.dedent(__doc__) % \
{"AvailableConnectorstyles": _pprint_styles(_style_list)}
-
+
class ArrowStyle(_Style):
"""
:class:`ArrowStyle` is a container class which defines several
@@ -2543,12 +2543,12 @@
A arrowstyle object can be either created as
ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)
- or
+ or
ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)
or
-
+
ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")
Following classes are defined
@@ -2557,7 +2557,7 @@
An instance of any arrow style class is an callable object,
- whose call signature is
+ whose call signature is::
__call__(self, path, mutation_size, linewidth, aspect_ratio=1.)
@@ -2795,14 +2795,14 @@
class CurveA(_Curve):
"""
- An arrow with a head at its begin point.
+ An arrow with a head at its begin point.
"""
def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
-
+
*head_width*
width of the arrow head
"""
@@ -2816,14 +2816,14 @@
class CurveB(_Curve):
"""
- An arrow with a head at its end point.
+ An arrow with a head at its end point.
"""
def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
-
+
*head_width*
width of the arrow head
"""
@@ -2837,14 +2837,14 @@
class CurveAB(_Curve):
"""
- An arrow with heads both at the begin and the end point.
+ An arrow with heads both at the begin and the end point.
"""
def __init__(self, head_length=.4, head_width=.2):
"""
*head_length*
length of the arrow head
-
+
*head_width*
width of the arrow head
"""
@@ -2859,7 +2859,7 @@
class _Bracket(_Base):
def __init__(self, bracketA=None, bracketB=None,
- widthA=1., widthB=1.,
+ widthA=1., widthB=1.,
lengthA=0.2, lengthB=0.2,
angleA=None, angleB=None,
scaleA=None, scaleB=None
@@ -2870,8 +2870,8 @@
self.angleA, self.angleB = angleA, angleB
self.scaleA, self.scaleB= scaleA, scaleB
- def _get_bracket(self, x0, y0,
- cos_t, sin_t, width, length,
+ def _get_bracket(self, x0, y0,
+ cos_t, sin_t, width, length,
):
# arrow from x0, y0 to x1, y1
@@ -2949,10 +2949,10 @@
"""
*widthB*
width of the bracket
-
+
*lengthB*
length of the bracket
-
+
*angleB*
angle between the bracket and the line
"""
@@ -2975,12 +2975,12 @@
*head_with*
width of the arrow head
-
+
*tail_width*
width of the arrow tail
"""
-
+
self.head_length, self.head_width, self.tail_width = \
head_length, head_width, tail_width
super(ArrowStyle.Simple, self).__init__()
@@ -3043,7 +3043,7 @@
*head_with*
width of the arrow head
-
+
*tail_width*
width of the arrow tail
@@ -3140,7 +3140,7 @@
Wedge(?) shape. Only wokrs with a quadratic bezier curve. The
begin point has a width of the tail_width and the end point has a
width of 0. At the middle, the width is shrink_factor*tail_width.
-
+
"""
def __init__(self, tail_width=.3, shrink_factor=0.5):
@@ -3151,7 +3151,7 @@
*shrink_factor*
fraction of the arrow width at the middle point
"""
-
+
self.tail_width = tail_width
self.shrink_factor = shrink_factor
super(ArrowStyle.Wedge, self).__init__()
@@ -3191,7 +3191,7 @@
A fancy arrow patch. It draws an arrow using the :class:ArrowStyle.
"""
-
+
def __str__(self):
return self.__class__.__name__ \
+ "FancyArrowPatch(%g,%g,%g,%g,%g,%g)" % tuple(self._q_bezier)
@@ -3340,8 +3340,8 @@
self._connector = connectionstyle
else:
self._connector = ConnectionStyle(connectionstyle, **kw)
-
+
def get_connectionstyle(self):
"""
Return the ConnectionStyle instance
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-08 20:21:37
|
Revision: 6516
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6516&view=rev
Author: ryanmay
Date: 2008-12-08 20:21:33 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Correct typo in comment.
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/line_collection2.py
Modified: trunk/matplotlib/examples/pylab_examples/line_collection2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/line_collection2.py 2008-12-08 17:05:28 UTC (rev 6515)
+++ trunk/matplotlib/examples/pylab_examples/line_collection2.py 2008-12-08 20:21:33 UTC (rev 6516)
@@ -10,7 +10,7 @@
# Here are many sets of y to plot vs x
ys = [x+i for i in x]
-# We need to set the plot limits, the will not autoscale
+# We need to set the plot limits, they will not autoscale
ax = axes()
ax.set_xlim((amin(x),amax(x)))
ax.set_ylim((amin(amin(ys)),amax(amax(ys))))
@@ -32,5 +32,3 @@
ax.set_title('Line Collection with mapped colors')
sci(line_segments) # This allows interactive changing of the colormap.
show()
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-08 17:05:31
|
Revision: 6515
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6515&view=rev
Author: mdboom
Date: 2008-12-08 17:05:28 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Updated changelog.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-08 17:00:12 UTC (rev 6514)
+++ trunk/matplotlib/CHANGELOG 2008-12-08 17:05:28 UTC (rev 6515)
@@ -1,3 +1,5 @@
+2008-12-08 Fixed alignment of ticks in colorbars. -MGD
+
2008-12-07 drop the deprecated "new" keyword of np.histogram() for
numpy 1.2 or later. -JJL
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-08 17:00:15
|
Revision: 6514
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6514&view=rev
Author: jswhit
Date: 2008-12-08 17:00:12 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
fix drawlsmask so it works for cylindrical projections that have limits
outside -180,180
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-12-08 16:31:48 UTC (rev 6513)
+++ trunk/toolkits/basemap/Changelog 2008-12-08 17:00:12 UTC (rev 6514)
@@ -1,4 +1,6 @@
version 0.99.2 (not yet released)
+ * fix drawlsmask method so that it works for cylindrical
+ projections with limits outside (-180,180).
* added 'scale' keyword to bluemarble and warpimage methods to
downsample image background.
* Made lat_ts default to 0 for mercator.
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 16:31:48 UTC (rev 6513)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 17:00:12 UTC (rev 6514)
@@ -3082,12 +3082,25 @@
lsmask_lats = np.arange(-90.+0.5*delta,90.,delta)
lsmask = np.reshape(np.fromstring(lsmaskf.read(),np.uint8),(nlats,nlons))
lsmaskf.close()
- # instance variable lsmask is set on first invocation,
- # it contains the land-sea mask interpolated to the native
- # projection grid. Further calls to drawlsmask will not
- # redo the interpolation (unless a new land-sea mask is passed
- # in via the lsmask, lsmask_lons, lsmask_lats keywords).
+ # instance variable lsmask is set on first invocation,
+ # it contains the land-sea mask interpolated to the native
+ # projection grid. Further calls to drawlsmask will not
+ # redo the interpolation (unless a new land-sea mask is passed
+ # in via the lsmask, lsmask_lons, lsmask_lats keywords).
+ # is it a cylindrical projection whose limits lie
+ # outside the limits of the image?
+ cylproj = self.projection in _cylproj and \
+ (self.urcrnrlon > lsmask_lons[-1] or \
+ self.llcrnrlon < lsmask_lons[0])
+ if cylproj:
+ # stack grids side-by-side (in longitiudinal direction), so
+ # any range of longitudes may be plotted on a world map.
+ lsmask_lons = \
+ np.concatenate((lsmask_lons,lsmask_lons+360),1)
+ lsmask = \
+ np.concatenate((lsmask,lsmask),1)
+
# transform mask to nx x ny regularly spaced native projection grid
# nx and ny chosen to have roughly the same horizontal
# resolution as mask.
@@ -3097,7 +3110,7 @@
if self.projection == 'cyl':
dx = lsmask_lons[1]-lsmask_lons[0]
else:
- dx = 2.*math.pi*self.rmajor/float(nlons)
+ dx = (np.pi/180.)*(lsmask_lons[1]-lsmask_lons[0])*self.rmajor
nx = int((self.xmax-self.xmin)/dx)+1; ny = int((self.ymax-self.ymin)/dx)+1
# interpolate rgba values from proj='cyl' (geographic coords)
# to a rectangular map projection grid.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-08 16:31:53
|
Revision: 6513
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6513&view=rev
Author: jswhit
Date: 2008-12-08 16:31:48 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
added 'scale' keyword to bluemarble and warpimage to downsample background
image (replaces 'resolution' keyword from previous commit).
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/examples/warpimage.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Removed Paths:
-------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-12-08 16:10:50 UTC (rev 6512)
+++ trunk/toolkits/basemap/Changelog 2008-12-08 16:31:48 UTC (rev 6513)
@@ -1,5 +1,6 @@
version 0.99.2 (not yet released)
- * added half resolution blue marble image (resolution='low')
+ * added 'scale' keyword to bluemarble and warpimage methods to
+ downsample image background.
* Made lat_ts default to 0 for mercator.
* Now can specify just lon_0 for all cylindrical projections
(to produce global map centered on lon_0).
Modified: trunk/toolkits/basemap/examples/warpimage.py
===================================================================
--- trunk/toolkits/basemap/examples/warpimage.py 2008-12-08 16:10:50 UTC (rev 6512)
+++ trunk/toolkits/basemap/examples/warpimage.py 2008-12-08 16:31:48 UTC (rev 6513)
@@ -24,7 +24,7 @@
fig=plt.figure()
# define projection centered on North America.
m = Basemap(projection='mbtfpq',lon_0=-100,resolution='l')
-m.bluemarble(resolution='low')
+m.bluemarble(scale=0.5)
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines every 30 degrees.
@@ -38,7 +38,7 @@
# define cylindrical equidistant projection.
m = Basemap(projection='cyl',llcrnrlon=-180,llcrnrlat=-90,urcrnrlon=180,urcrnrlat=90,resolution='l')
# plot (unwarped) rgba image.
-im = m.bluemarble(resolution='low')
+im = m.bluemarble(scale=0.5)
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines.
@@ -52,7 +52,7 @@
# define cylindrical equidistant projection.
m = Basemap(projection='cyl',llcrnrlon=0,llcrnrlat=-60,urcrnrlon=360,urcrnrlat=60,resolution='l')
# plot (unwarped) rgba image.
-im = m.bluemarble(resolution='low')
+im = m.bluemarble(scale=0.5)
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines.
@@ -81,7 +81,7 @@
m = Basemap(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
rsphere=(6378137.00,6356752.3142),lat_1=50.,lon_0=-107.,\
resolution='i',area_thresh=1000.,projection='lcc')
-im = m.bluemarble(resolution='low')
+im = m.bluemarble(scale=0.5)
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw parallels and meridians.
@@ -100,7 +100,7 @@
resolution=None,projection='omerc',\
lon_0=-100,lat_0=15,lon_2=-120,lat_2=65,lon_1=-50,lat_1=-55)
# plot warped rgba image.
-im = m.bluemarble(resolution='low')
+im = m.bluemarble(scale=0.5)
# draw lat/lon grid lines every 20 degrees.
m.drawmeridians(np.arange(0,360,20),color='0.5')
m.drawparallels(np.arange(-80,81,20),color='0.5')
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 16:10:50 UTC (rev 6512)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 16:31:48 UTC (rev 6513)
@@ -3135,17 +3135,20 @@
im = self.imshow(rgba,interpolation='nearest',ax=ax,**kwargs)
return im
- def bluemarble(self,ax=None,resolution='high'):
+ def bluemarble(self,ax=None,scale=None):
"""
display blue marble image (from http://visibleearth.nasa.gov)
as map background.
+ Default image size is 5400x2700, which can be quite slow and
+ use quite a bit of memory. The ``scale`` keyword can be used
+ to downsample the image (``scale=0.5`` downsamples to 2700x1350).
"""
if ax is not None:
- self.warpimage(image='bluemarble',ax=ax,resolution=resolution)
+ self.warpimage(image='bluemarble',ax=ax,scale=scale)
else:
- self.warpimage(image='bluemarble',resolution=resolution)
+ self.warpimage(image='bluemarble',scale=scale)
- def warpimage(self,image="bluemarble",resolution='high',**kwargs):
+ def warpimage(self,image="bluemarble",scale=None,**kwargs):
"""
Display an image (filename given by ``image`` keyword) as a map background.
If image is a URL (starts with 'http'), it is downloaded to a temp
@@ -3159,6 +3162,10 @@
Works with the global images from
http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php.
+ The ``scale`` keyword can be used to downsample (rescale) the image.
+ Values less than 1.0 will speed things up at the expense of image
+ resolution.
+
Extra keyword ``ax`` can be used to override the default axis instance.
\**kwargs passed on to :meth:`imshow`.
@@ -3181,10 +3188,7 @@
# default image file is blue marble next generation
# from NASA (http://visibleearth.nasa.gov).
if image == "bluemarble":
- if resolution == 'low':
- file = os.path.join(basemap_datadir,'bmng_low.jpg')
- else:
- file = os.path.join(basemap_datadir,'bmng.jpg')
+ file = os.path.join(basemap_datadir,'bmng.jpg')
else:
file = image
# if image is same as previous invocation, used cached data.
@@ -3206,6 +3210,11 @@
# read in jpeg image to rgba array of normalized floats.
if not hasattr(self,'_bm_rgba') or newfile:
pilImage = Image.open(self._bm_file)
+ if scale is not None:
+ w, h = pilImage.size
+ width = int(np.round(w*scale))
+ height = int(np.round(h*scale))
+ pilImage = pilImage.resize((width,height),Image.ANTIALIAS)
self._bm_rgba = pil_to_array(pilImage)
# define lat/lon grid that image spans.
nlons = self._bm_rgba.shape[1]; nlats = self._bm_rgba.shape[0]
Deleted: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|