|
From: <jd...@us...> - 2008-01-08 18:58:44
|
Revision: 4813
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4813&view=rev
Author: jdh2358
Date: 2008-01-08 10:58:39 -0800 (Tue, 08 Jan 2008)
Log Message:
-----------
fixed perrys typos
Modified Paths:
--------------
trunk/matplotlib/INSTALL
trunk/matplotlib/MIGRATION.txt
Modified: trunk/matplotlib/INSTALL
===================================================================
--- trunk/matplotlib/INSTALL 2008-01-08 18:58:26 UTC (rev 4812)
+++ trunk/matplotlib/INSTALL 2008-01-08 18:58:39 UTC (rev 4813)
@@ -30,9 +30,9 @@
you can set.
If you want to use a GUI backend, you will need either Tkinter,
- pygtk or wxpython installed on your system, from src or from a
+ pygtk , wxPython or Qt installed on your system, from src or from a
package manager including the devel packages. You can choose which
- backends to enable by setting the flags in setup.py, but the default
+ backends to enable by setting the flags in setup.cfg, but the default
is to automatically detect your installed GUIs and build support for
them. If you later find that you did not have a GUI toolkit like
pygtk installed when you built matplotlib, but now want it, you will
Modified: trunk/matplotlib/MIGRATION.txt
===================================================================
--- trunk/matplotlib/MIGRATION.txt 2008-01-08 18:58:26 UTC (rev 4812)
+++ trunk/matplotlib/MIGRATION.txt 2008-01-08 18:58:39 UTC (rev 4813)
@@ -1,9 +1,9 @@
Migrating to the new matplotlib codebase
========================================
-Michael Droettboom has spent the last several month working on the
+Michael Droettboom has spent the last several months working on the
"transforms branch" of matplotlib, in which he rewrote from the ground
-up the transformation infrastructure in matplotlib, whih many found
+up the transformation infrastructure in matplotlib, which many found
unintuitive and hard to extend. In addition to a cleaner code base,
the refactoring allows you to define your own trasformations and
projections (eg map projections) within matplotlib. He has merged his
@@ -13,10 +13,10 @@
If you are a svn user, we encourage you to continue using the trunk as
before, but with the understanding that you are now truly on the
bleeding edge. Michael has made sure all the examples still pass with
-the new code base, so for the vast majority of you, I except to see
+the new code base, so for the vast majority of you, I expect to see
few problems. But we need to get as many people as possible using the
new code base so we can find and fix the remaining problems. We have
-take the svn cde used in the last stable release in the 0.91 series,
+take the svn code used in the last stable release in the 0.91 series,
and made it a maintenance branch so we can still fix bugs and support
people who are not ready to migrate to the new transformation
infrastructure but nonetheless need acccess to svn bug fixes.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-01-08 21:43:34
|
Revision: 4817
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4817&view=rev
Author: mdboom
Date: 2008-01-08 13:42:26 -0800 (Tue, 08 Jan 2008)
Log Message:
-----------
Merged revisions 3807-3808,3811-3812,3814-3823,3825-3830,3832-3835,3837-3846,3848-3865,3867-3869,3871-3872,3874-3884,3886-3895,3897-3905,3907-3908,3910-3924,3926-3928,3930-3932,3934-3955,3957-3961,3963-3983,3985-4000,4002-4058,4060-4134,4136-4191,4193-4219,4221-4243,4245-4291,4293-4317,4319-4329,4331-4339,4341-4392,4394,4396-4400,4402-4405,4407-4436,4438-4443,4445-4490,4492-4495,4497-4498,4500-4505,4507-4561,4563-4615,4617-4618,4620,4622-4633,4635-4667,4670-4687,4690-4707,4709-4714,4716-4726,4728-4734,4736-4757,4759-4772,4774-4786,4788-4800,4802-4803,4805-4816 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/transforms
................
r3822 | mdboom | 2007-09-10 13:39:37 -0400 (Mon, 10 Sep 2007) | 2 lines
Baby steps and horrible breakage on transforms branch.
................
r3823 | mdboom | 2007-09-10 13:40:47 -0400 (Mon, 10 Sep 2007) | 1 line
Adding new files that will eventually replace transforms.py/cpp
................
r3826 | mdboom | 2007-09-10 15:25:21 -0400 (Mon, 10 Sep 2007) | 3 lines
Running mathtext_demo.py without transforms.py/cpp. Totally broken,
though. Not surprising... ;)
................
r3830 | mdboom | 2007-09-11 13:56:13 -0400 (Tue, 11 Sep 2007) | 2 lines
Just marking a milestone -- about to totally rip things up again.
................
r3835 | mdboom | 2007-09-12 09:36:25 -0400 (Wed, 12 Sep 2007) | 2 lines
Second pass, using a stateful transform tree.
................
r3837 | mdboom | 2007-09-12 10:46:03 -0400 (Wed, 12 Sep 2007) | 1 line
Adding pbox.py
................
r3838 | jdh2358 | 2007-09-12 11:41:22 -0400 (Wed, 12 Sep 2007) | 1 line
removed Interval from canonical tickers and formatters
................
r3839 | mdboom | 2007-09-12 13:25:19 -0400 (Wed, 12 Sep 2007) | 3 lines
Milestone -- simple_plot.py working with new affine framework (with
the exception of dpi propagation)
................
r3842 | mdboom | 2007-09-12 15:47:56 -0400 (Wed, 12 Sep 2007) | 2 lines
More progress. Zooming and panning working thanks to John's patch.
................
r3843 | jdh2358 | 2007-09-12 16:25:17 -0400 (Wed, 12 Sep 2007) | 1 line
minor changes for gtk navigation
................
r3846 | mdboom | 2007-09-13 08:44:16 -0400 (Thu, 13 Sep 2007) | 2 lines
Minor changes -- committing so I can merge again.
................
r3848 | mdboom | 2007-09-13 14:00:10 -0400 (Thu, 13 Sep 2007) | 3 lines
New milestone -- resizing figure window works. shared_axis_demo.py
works. (Uses callbacks to track changes between axes's).
................
r3849 | mdboom | 2007-09-14 08:23:06 -0400 (Fri, 14 Sep 2007) | 2 lines
Committing this file so I can rename it
................
r3850 | mdboom | 2007-09-14 08:24:20 -0400 (Fri, 14 Sep 2007) | 2 lines
Deleting this file to rename affine.py
................
r3851 | mdboom | 2007-09-14 09:03:31 -0400 (Fri, 14 Sep 2007) | 4 lines
Removed transforms on the C++ side -- removed many methods that depend
on it in backend_agg in preparation for path generalization.
Lots of general renaming...
................
r3852 | mdboom | 2007-09-14 13:57:52 -0400 (Fri, 14 Sep 2007) | 6 lines
Sends paths to backend only once, and after that uses the "native" path by
reference with a changing transform. Started recongfiguring
patches.py to use only Paths under the hood (to take advantage of this
caching). Removed many methods from backend_agg that should
eventually be replaced by draw_path, at least in theory.
................
r3854 | mdboom | 2007-09-17 09:41:38 -0400 (Mon, 17 Sep 2007) | 1 line
Transferring work-in-progress
................
r3855 | mdboom | 2007-09-18 12:21:37 -0400 (Tue, 18 Sep 2007) | 3 lines
More code using new transformation framework. Lots of dead code
removed from backend_agg.cpp/h
................
r3856 | mdboom | 2007-09-18 15:29:21 -0400 (Tue, 18 Sep 2007) | 5 lines
Optimize shared axes (to prevent calling set_xlim/set_ylim more than
once per axes per update).
Save figure at correct dpi.
General cleanup and optimizations.
................
r3857 | mdboom | 2007-09-19 09:28:11 -0400 (Wed, 19 Sep 2007) | 2 lines
Got legend working with new transforms
................
r3858 | mdboom | 2007-09-19 12:18:51 -0400 (Wed, 19 Sep 2007) | 2 lines
Got steps_demo.py working
................
r3859 | mdboom | 2007-09-19 15:46:34 -0400 (Wed, 19 Sep 2007) | 2 lines
Lots of minor fixes
................
r3860 | mdboom | 2007-09-19 15:48:17 -0400 (Wed, 19 Sep 2007) | 2 lines
Use iterator rather than caching approach for paths
................
r3864 | mdboom | 2007-09-20 09:57:32 -0400 (Thu, 20 Sep 2007) | 2 lines
Simplification of marker paths.
................
r3865 | mdboom | 2007-09-20 09:57:59 -0400 (Thu, 20 Sep 2007) | 2 lines
Go all out with iterator (rather than copy) approach, as it is much faster.
................
r3868 | mdboom | 2007-09-20 10:26:27 -0400 (Thu, 20 Sep 2007) | 2 lines
Don't copy path array to a contiguous one.
................
r3869 | mdboom | 2007-09-20 14:00:32 -0400 (Thu, 20 Sep 2007) | 3 lines
First baby step in getting arbitrary non-linear transformations into
the pipeline.
................
r3872 | mdboom | 2007-09-21 12:52:50 -0400 (Fri, 21 Sep 2007) | 6 lines
Further progress on arbitrary transformations -- zooming and panning
now works without any log-scale-specific hacks. (Though the
underlying model is slightly wrong.)
Added graphviz output support for debugging transformation trees.
Masked array handling much more robust.
................
r3884 | mdboom | 2007-09-24 12:53:38 -0400 (Mon, 24 Sep 2007) | 2 lines
More progress. (Kind of a broken mess at the moment.)
................
r3886 | mdboom | 2007-09-24 13:33:03 -0400 (Mon, 24 Sep 2007) | 2 lines
Fixed log scaling again.
................
r3889 | mdboom | 2007-09-25 13:04:51 -0400 (Tue, 25 Sep 2007) | 2 lines
Automaticall separate affine from non-affine transforms
................
r3890 | mdboom | 2007-09-25 14:29:44 -0400 (Tue, 25 Sep 2007) | 2 lines
Minor speed improvements in new transformations.
................
r3892 | mdboom | 2007-09-25 15:53:56 -0400 (Tue, 25 Sep 2007) | 2 lines
Important bugfixes.
................
r3893 | mdboom | 2007-09-26 08:29:05 -0400 (Wed, 26 Sep 2007) | 2 lines
Committing simple_ploy_fps.py
................
r3895 | mdboom | 2007-09-26 09:53:53 -0400 (Wed, 26 Sep 2007) | 2 lines
Fix log limits. For minor speed improvements.
................
r3897 | mdboom | 2007-09-26 10:08:12 -0400 (Wed, 26 Sep 2007) | 2 lines
Fix log transforms a little.
................
r3905 | mdboom | 2007-10-01 07:44:54 -0400 (Mon, 01 Oct 2007) | 2 lines
Move ticking/formatting defaults to scale.py. Speed improvements in transforms.py
................
r3908 | mdboom | 2007-10-03 08:50:04 -0400 (Wed, 03 Oct 2007) | 2 lines
Lots of progress on Polar transform refactoring. Added point_in_path algorithm.
................
r3912 | mdboom | 2007-10-04 13:21:26 -0400 (Thu, 04 Oct 2007) | 4 lines
Lots of new docstrings. Reasonably good state for polar plots.
r-axis labels can be dragged on polar plots. r-scale can be zoomed on
polar plot. Lots of other minor changes too numerous to mention.
................
r3913 | mdboom | 2007-10-04 13:22:01 -0400 (Thu, 04 Oct 2007) | 3 lines
Sharing axes across figures is much easier now (it is the same as
within the same figure), so this demo has been updated.
................
r3914 | mdboom | 2007-10-04 14:57:27 -0400 (Thu, 04 Oct 2007) | 2 lines
Progress on agg_buffer_to_array example.
................
r3915 | mdboom | 2007-10-04 15:12:20 -0400 (Thu, 04 Oct 2007) | 3 lines
Merged from trunk (a somewhat hairy manual merge this time). Fixed
bug (on this branch only) where inverted axes were broken.
................
r3924 | mdboom | 2007-10-05 15:25:33 -0400 (Fri, 05 Oct 2007) | 4 lines
Simplified sharing axes again.
Plowing through -- making more examples work.
First pass at updating collections (LineCollection mostly works)
................
r3928 | mdboom | 2007-10-08 14:10:11 -0400 (Mon, 08 Oct 2007) | 2 lines
More work on collections.
................
r3932 | mdboom | 2007-10-10 09:37:28 -0400 (Wed, 10 Oct 2007) | 2 lines
Lots more work on making examples work. Details, details, details...
................
r3934 | mdboom | 2007-10-11 11:42:53 -0400 (Thu, 11 Oct 2007) | 3 lines
Continued progress getting more examples to work. Working examples
(with TkAgg backend only) are marked in PASSED_DEMOS for the curious.
................
r3937 | mdboom | 2007-10-12 08:27:25 -0400 (Fri, 12 Oct 2007) | 3 lines
First pass through all of the examples -- not all working yet,
though. (See PASSED_DEMOS).
................
r3938 | mdboom | 2007-10-12 10:29:57 -0400 (Fri, 12 Oct 2007) | 1 line
Forgot the __init__.py
................
r3939 | mdboom | 2007-10-12 13:30:17 -0400 (Fri, 12 Oct 2007) | 2 lines
More progress on examples.
................
r3947 | mdboom | 2007-10-15 09:49:25 -0400 (Mon, 15 Oct 2007) | 3 lines
Significant speed improvement in text layout. Reverted to fix bug in
ticklabels. Lots of other minor things.
................
r3948 | mdboom | 2007-10-15 10:03:19 -0400 (Mon, 15 Oct 2007) | 13 lines
Merged revisions 3933-3947 via svnmerge from
http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib
........
r3935 | mdboom | 2007-10-11 13:03:50 -0400 (Thu, 11 Oct 2007) | 1 line
Fixed minor import bug
........
r3941 | jdh2358 | 2007-10-14 15:00:50 -0400 (Sun, 14 Oct 2007) | 1 line
added ellipse compare script
........
................
r3955 | mdboom | 2007-10-16 10:17:53 -0400 (Tue, 16 Oct 2007) | 2 lines
First pass at PS backend updates.
................
r3957 | mdboom | 2007-10-16 10:41:29 -0400 (Tue, 16 Oct 2007) | 1 line
Fixing mistake in last merge
................
r3958 | mdboom | 2007-10-16 15:39:57 -0400 (Tue, 16 Oct 2007) | 3 lines
figlegends work now. (Phew!) Rendering quality fixes drawing
axis-aligned line segments in Agg.
................
r3960 | mdboom | 2007-10-18 10:51:16 -0400 (Thu, 18 Oct 2007) | 2 lines
More examples working. Minor speedups.
................
r3965 | mdboom | 2007-10-18 14:11:59 -0400 (Thu, 18 Oct 2007) | 2 lines
First pass at working PDF backend.
................
r3981 | mdboom | 2007-10-23 10:23:19 -0400 (Tue, 23 Oct 2007) | 2 lines
Decreasing polar interpolation resolution.
................
r3982 | mdboom | 2007-10-23 10:24:49 -0400 (Tue, 23 Oct 2007) | 3 lines
Marker objects should be keyed off of whether or not they are filled
and their line width (since the line width affects the bounding box).
................
r3983 | mdboom | 2007-10-23 10:25:49 -0400 (Tue, 23 Oct 2007) | 2 lines
First pass at SVG support
................
r3985 | mdboom | 2007-10-23 12:40:25 -0400 (Tue, 23 Oct 2007) | 3 lines
More progress on SVG. Refactored PS collection drawing to make it
easier to reuse the (fairly complex) code.
................
r3986 | mdboom | 2007-10-23 12:54:51 -0400 (Tue, 23 Oct 2007) | 2 lines
Fix bug that broke draw_image
................
r3987 | mdboom | 2007-10-23 15:16:11 -0400 (Tue, 23 Oct 2007) | 2 lines
Fix bugs in log_demo.py
................
r3988 | mdboom | 2007-10-23 15:20:21 -0400 (Tue, 23 Oct 2007) | 2 lines
Reduce tendency to use aliased drawing.
................
r3989 | mdboom | 2007-10-23 15:47:43 -0400 (Tue, 23 Oct 2007) | 2 lines
Fix bug in clipping rectangle in PDF
................
r3990 | mdboom | 2007-10-23 15:48:14 -0400 (Tue, 23 Oct 2007) | 2 lines
Fix bug affecting legend_auto.py
................
r3992 | mdboom | 2007-10-24 12:03:49 -0400 (Wed, 24 Oct 2007) | 2 lines
Separated path utilities from backend_agg
................
r3993 | mdboom | 2007-10-24 13:11:00 -0400 (Wed, 24 Oct 2007) | 2 lines
Forgot to svn add these files in last commit.
................
r3994 | mdboom | 2007-10-24 14:01:26 -0400 (Wed, 24 Oct 2007) | 2 lines
Removing a limits change that shouldn't have been committed.
................
r3995 | mdboom | 2007-10-24 14:12:19 -0400 (Wed, 24 Oct 2007) | 2 lines
Fix masked array plotting again.
................
r3996 | mdboom | 2007-10-24 14:49:08 -0400 (Wed, 24 Oct 2007) | 3 lines
Initial pass of Gtk, Qt, Qt4, Fltk and Wx GUI backends. Lots more
examples passing.
................
r3997 | mdboom | 2007-10-24 15:22:00 -0400 (Wed, 24 Oct 2007) | 5 lines
Renamed [xmin, ymin, xmax, ymax] in Bbox to [x0, y0, x1, y1] and
provide functions that really do give xmax etc. as well.
Renamed lbrt to extents and lbwh to bounds (for consistency).
Removed some dead code.
................
r3998 | mdboom | 2007-10-24 15:42:49 -0400 (Wed, 24 Oct 2007) | 2 lines
More examples working.
................
r4000 | mdboom | 2007-10-25 10:07:44 -0400 (Thu, 25 Oct 2007) | 3 lines
table_demo working. Lots of minor fixes. Faster transforms when
debugging is turned off.
................
r4004 | mdboom | 2007-10-25 15:16:11 -0400 (Thu, 25 Oct 2007) | 3 lines
Increased coverage of backend_driver.py to include almost everything
in axes.py. Lots of little bug fixes.
................
r4011 | mdboom | 2007-10-26 11:58:50 -0400 (Fri, 26 Oct 2007) | 2 lines
More coverage. Add draw_path_collection to SVG.
................
r4012 | mdboom | 2007-10-26 13:01:28 -0400 (Fri, 26 Oct 2007) | 2 lines
Added BboxTransformFrom/To for more efficient bounding box transforms.
................
r4017 | mdboom | 2007-10-26 14:00:23 -0400 (Fri, 26 Oct 2007) | 2 lines
Removed unused imports.
................
r4018 | mdboom | 2007-10-26 14:04:51 -0400 (Fri, 26 Oct 2007) | 2 lines
Fix polar plot title so it doesn't clash with 90 degree value.
................
r4019 | mdboom | 2007-10-26 14:32:44 -0400 (Fri, 26 Oct 2007) | 3 lines
Can't drag zoom on a polar plot.
Finessing Agg drawing quality a little bit.
................
r4052 | mdboom | 2007-10-29 11:20:13 -0400 (Mon, 29 Oct 2007) | 2 lines
Revert this example to like it is in the trunk.
................
r4053 | mdboom | 2007-10-29 11:21:49 -0400 (Mon, 29 Oct 2007) | 2 lines
Lots of minor bug fixes.
................
r4054 | mdboom | 2007-10-29 12:55:53 -0400 (Mon, 29 Oct 2007) | 2 lines
More examples working.
................
r4055 | mdboom | 2007-10-29 13:31:24 -0400 (Mon, 29 Oct 2007) | 2 lines
Massive CHANGELOG and API_CHANGES entries about this refactoring.
................
r4056 | mdboom | 2007-10-29 13:39:06 -0400 (Mon, 29 Oct 2007) | 2 lines
Oops -- this shouldn't have been committed.
................
r4058 | mdboom | 2007-10-29 14:20:11 -0400 (Mon, 29 Oct 2007) | 2 lines
Updated.
................
r4060 | mdboom | 2007-10-29 14:37:17 -0400 (Mon, 29 Oct 2007) | 2 lines
Fix clip path in polar plot legend.
................
r4122 | mdboom | 2007-11-06 10:37:44 -0500 (Tue, 06 Nov 2007) | 3 lines
Minor speed improvement (thanks to Eric Firing).
Also use matplotlib.numerix.npyma instead of numpy.ma
................
r4123 | mdboom | 2007-11-06 10:48:22 -0500 (Tue, 06 Nov 2007) | 2 lines
Mistake in last commit.
................
r4124 | mdboom | 2007-11-06 10:50:51 -0500 (Tue, 06 Nov 2007) | 2 lines
Update docstring to reflect reality.
................
r4133 | mdboom | 2007-11-06 14:46:45 -0500 (Tue, 06 Nov 2007) | 2 lines
Updated docstring to reflect current reality.
................
r4134 | mdboom | 2007-11-06 14:48:40 -0500 (Tue, 06 Nov 2007) | 2 lines
Use "from matplotlib.numerix import npyma as ma"
................
r4136 | mdboom | 2007-11-06 16:33:37 -0500 (Tue, 06 Nov 2007) | 10 lines
Speed up pcolor_demo.py "benchmark" initialization by a factor of 2.
Cache the automatically created path codes by their length.
pcolor, quadmesh etc. create lots of polylines of the same length, and
there is no need to create a new identical codes array each time.
(Definite speed improvement, incredible memory improvement).
Change the default behavior to create open paths (which don't result
in a memory copy). Fix places that were relying on
automatically-created closed paths to create closed paths themselves
(and thus avoiding a copy).
................
r4142 | mdboom | 2007-11-07 10:31:37 -0500 (Wed, 07 Nov 2007) | 7 lines
Further speed improvements. For collections, now has faster ignoring
of elements that aren't provided, such as offsets. Paths now do not
even store the "default" codes array -- which is MOVETO followed by N
LINETOs. These are generated automatically by the iterators if no
codes array is provided. (Should also result in significant memory
savings for graphs with many points.)
................
r4152 | mdboom | 2007-11-07 15:13:35 -0500 (Wed, 07 Nov 2007) | 4 lines
Further speed improvements. Quadmesh extension code (still not as
fast as the old version, for various reasons.)
Fix bugs in quadmesh masking in PDF and PS backends.
................
r4153 | mdboom | 2007-11-07 15:38:46 -0500 (Wed, 07 Nov 2007) | 2 lines
Update to use modern Numpy C API
................
r4154 | mdboom | 2007-11-07 16:20:45 -0500 (Wed, 07 Nov 2007) | 2 lines
First pass at Cairo support on the branch.
................
r4157 | mdboom | 2007-11-08 08:21:17 -0500 (Thu, 08 Nov 2007) | 2 lines
Small bugfix to compile on gcc 4.x (Thanks, Eric)
................
r4158 | mdboom | 2007-11-08 09:05:18 -0500 (Thu, 08 Nov 2007) | 3 lines
Add a background color to the axes so it's easier to tell if there is
a bug in the masked values.
................
r4159 | mdboom | 2007-11-08 09:06:25 -0500 (Thu, 08 Nov 2007) | 3 lines
Get wxagg extension working again. Factor out the new Bbox conversion
code into agg_py_transforms.h
................
r4161 | mdboom | 2007-11-08 11:26:31 -0500 (Thu, 08 Nov 2007) | 2 lines
Updating the simple_plot_fps benchmark.
................
r4162 | mdboom | 2007-11-08 11:27:18 -0500 (Thu, 08 Nov 2007) | 2 lines
Put a generic non-optimized draw_markers implementation in backend_bases.
................
r4184 | mdboom | 2007-11-09 11:33:58 -0500 (Fri, 09 Nov 2007) | 2 lines
Fix misaligned clipping rectangle.
................
r4185 | mdboom | 2007-11-09 11:35:15 -0500 (Fri, 09 Nov 2007) | 2 lines
Get wx backend working with wxGraphicsContext drawing.
................
r4186 | mdboom | 2007-11-09 11:40:25 -0500 (Fri, 09 Nov 2007) | 2 lines
Removed debugging message.
................
r4189 | mdboom | 2007-11-09 14:09:42 -0500 (Fri, 09 Nov 2007) | 2 lines
Add support for nonuniform grids to imshow.
................
r4190 | mdboom | 2007-11-09 14:23:42 -0500 (Fri, 09 Nov 2007) | 1 line
Merging trunk to branch
................
r4245 | mdboom | 2007-11-13 11:02:47 -0500 (Tue, 13 Nov 2007) | 2 lines
Bug fixes.
................
r4246 | mdboom | 2007-11-13 11:08:24 -0500 (Tue, 13 Nov 2007) | 2 lines
Don't clip ticks.
................
r4247 | mdboom | 2007-11-13 11:08:33 -0500 (Tue, 13 Nov 2007) | 2 lines
Bugfix for polar plots.
................
r4282 | mdboom | 2007-11-14 13:36:45 -0500 (Wed, 14 Nov 2007) | 2 lines
Fix bug in PDF backend.
................
r4283 | mdboom | 2007-11-14 13:38:05 -0500 (Wed, 14 Nov 2007) | 2 lines
Fix alignment of clipping rectangles.
................
r4284 | mdboom | 2007-11-14 13:42:52 -0500 (Wed, 14 Nov 2007) | 2 lines
Update to use new numpy macros.
................
r4285 | mdboom | 2007-11-14 13:43:35 -0500 (Wed, 14 Nov 2007) | 2 lines
Build the path module (inadvertently removed during a merge).
................
r4286 | mdboom | 2007-11-14 13:44:39 -0500 (Wed, 14 Nov 2007) | 3 lines
New path-related utilities (used for an aborted attempt at fixing
contouring -- may be useful in other contexts in the future).
................
r4302 | mdboom | 2007-11-15 10:13:38 -0500 (Thu, 15 Nov 2007) | 2 lines
Fix Subplot backward-incompatibility.
................
r4303 | mdboom | 2007-11-15 10:14:47 -0500 (Thu, 15 Nov 2007) | 5 lines
Cairo backend fixes:
- Avoid crash when path is too long
- Fix alpha filling
- Fix path clipping
................
r4304 | mdboom | 2007-11-15 10:15:21 -0500 (Thu, 15 Nov 2007) | 2 lines
Minor speed improvements.
................
r4305 | mdboom | 2007-11-15 10:18:42 -0500 (Thu, 15 Nov 2007) | 2 lines
Speed improvements.
................
r4306 | mdboom | 2007-11-15 11:28:54 -0500 (Thu, 15 Nov 2007) | 2 lines
Speed improvements.
................
r4307 | mdboom | 2007-11-15 11:29:40 -0500 (Thu, 15 Nov 2007) | 2 lines
Updated benchmark
................
r4309 | mdboom | 2007-11-15 12:17:02 -0500 (Thu, 15 Nov 2007) | 2 lines
Bugfixes (getting some examples to work again).
................
r4311 | mdboom | 2007-11-15 13:10:54 -0500 (Thu, 15 Nov 2007) | 2 lines
Major speed improvement (duplicate draws were being emitted).
................
r4314 | mdboom | 2007-11-15 13:35:30 -0500 (Thu, 15 Nov 2007) | 2 lines
Fix colorbar drawing.
................
r4319 | mdboom | 2007-11-15 15:05:46 -0500 (Thu, 15 Nov 2007) | 2 lines
Fix value display in log-scaled plots.
................
r4320 | mdboom | 2007-11-15 15:26:03 -0500 (Thu, 15 Nov 2007) | 2 lines
Fix gridlines in log scale.
................
r4323 | mdboom | 2007-11-15 16:12:54 -0500 (Thu, 15 Nov 2007) | 2 lines
Don't create masked arrays unless we absolutely have to.
................
r4324 | mdboom | 2007-11-15 16:13:52 -0500 (Thu, 15 Nov 2007) | 2 lines
Speed up auto-legend.
................
r4333 | mdboom | 2007-11-16 10:53:57 -0500 (Fri, 16 Nov 2007) | 1 line
Upgrade to Agg 2.4; Stop building Agg SWIG wrappers and remove small dependency on them.
................
r4345 | mdboom | 2007-11-16 15:29:51 -0500 (Fri, 16 Nov 2007) | 2 lines
Minor speed improvement.
................
r4388 | mdboom | 2007-11-20 08:14:34 -0500 (Tue, 20 Nov 2007) | 3 lines
Reverting imshow -- these issues are being dealt with by Eric Firing
on the trunk.
................
r4392 | mdboom | 2007-11-20 08:50:04 -0500 (Tue, 20 Nov 2007) | 2 lines
Removing trailing whitespace so a merge from trunk will be possible.
................
r4398 | mdboom | 2007-11-20 16:00:20 -0500 (Tue, 20 Nov 2007) | 6 lines
Support mixed-mode rendering the PDF backend. This allows some things
to be rendered as vectors and some as rasters. At the moment, mostly
as a proof-of-concept, all quadmeshes are rendered as rasters with the
PDF backend.
Also make PDF backend resolution independent.
................
r4399 | mdboom | 2007-11-20 17:00:51 -0500 (Tue, 20 Nov 2007) | 4 lines
Reduce file sizes for mixed-mode PDFs by only outputting the part of
the image with non-transparent pixels.
Minor speed improvement in MixedModeRenderer.
................
r4439 | mdboom | 2007-11-26 10:18:40 -0500 (Mon, 26 Nov 2007) | 2 lines
Remove draw_arc (which isn't in the new backend renderer interface).
................
r4440 | mdboom | 2007-11-26 10:30:12 -0500 (Mon, 26 Nov 2007) | 2 lines
Support mixed-mode rendering in the SVG backend.
................
r4445 | mdboom | 2007-11-26 11:43:19 -0500 (Mon, 26 Nov 2007) | 2 lines
Fix compilation error on 64-bit platforms.
................
r4446 | mdboom | 2007-11-26 11:52:53 -0500 (Mon, 26 Nov 2007) | 3 lines
Fix zooming with bounding box in Gtk and Qt backends (others seem to
already work). Fix text rotation in Wx (non-Agg) backend.
................
r4447 | mdboom | 2007-11-26 11:59:29 -0500 (Mon, 26 Nov 2007) | 2 lines
Fix compile error on 64-bit platforms.
................
r4448 | mdboom | 2007-11-26 12:23:18 -0500 (Mon, 26 Nov 2007) | 2 lines
Still trying to fix compile error on 64-bit platforms...
................
r4469 | mdboom | 2007-11-27 12:40:45 -0500 (Tue, 27 Nov 2007) | 2 lines
Fix memory leak and increase performance in quadmesh drawing (Agg)
................
r4473 | mdboom | 2007-11-27 15:03:48 -0500 (Tue, 27 Nov 2007) | 2 lines
Improve speed of quad mesh drawing (by about 25%)
................
r4480 | mdboom | 2007-11-28 08:40:54 -0500 (Wed, 28 Nov 2007) | 3 lines
Fix marker drawing bug, and improve speed (by using buffers on the
stack if possible).
................
r4481 | mdboom | 2007-11-28 08:42:39 -0500 (Wed, 28 Nov 2007) | 2 lines
Major speed improvements for auto-placing of legends.
................
r4488 | mdboom | 2007-11-28 13:26:40 -0500 (Wed, 28 Nov 2007) | 2 lines
Increase performance of draw_markers in Agg backend
................
r4489 | mdboom | 2007-11-28 13:27:43 -0500 (Wed, 28 Nov 2007) | 2 lines
Speed improvements -- determine path extents in C
................
r4493 | mdboom | 2007-11-28 15:36:22 -0500 (Wed, 28 Nov 2007) | 2 lines
Fix PDF font size bug.
................
r4494 | mdboom | 2007-11-28 15:36:45 -0500 (Wed, 28 Nov 2007) | 2 lines
Fix Ps import bug
................
r4495 | mdboom | 2007-11-28 15:37:04 -0500 (Wed, 28 Nov 2007) | 2 lines
Minor fixes.
................
r4500 | mdboom | 2007-11-29 08:50:25 -0500 (Thu, 29 Nov 2007) | 2 lines
Fix mri_with_eeg example
................
r4501 | mdboom | 2007-11-29 10:40:42 -0500 (Thu, 29 Nov 2007) | 2 lines
Ran "astyle --style=ansi" to convert to ANSI style.
................
r4521 | mdboom | 2007-11-30 10:06:56 -0500 (Fri, 30 Nov 2007) | 2 lines
Get Gtk backend working.
................
r4523 | mdboom | 2007-11-30 10:50:13 -0500 (Fri, 30 Nov 2007) | 2 lines
Cleanup some variable names.
................
r4524 | mdboom | 2007-11-30 10:50:35 -0500 (Fri, 30 Nov 2007) | 2 lines
Fix bb numerals in mathtext.
................
r4525 | mdboom | 2007-11-30 10:51:18 -0500 (Fri, 30 Nov 2007) | 2 lines
Fix shadows (see pie_demo.py)
................
r4527 | mdboom | 2007-11-30 11:16:34 -0500 (Fri, 30 Nov 2007) | 2 lines
Fix Cairo alpha-blending.
................
r4565 | mdboom | 2007-12-03 12:14:20 -0500 (Mon, 03 Dec 2007) | 2 lines
Fix bug in pcolormesh.
................
r4566 | mdboom | 2007-12-03 12:15:06 -0500 (Mon, 03 Dec 2007) | 3 lines
Use non-equal dimensions for mesh to highlight bug in pcolormesh (if
it ever returns).
................
r4568 | mdboom | 2007-12-03 14:07:36 -0500 (Mon, 03 Dec 2007) | 3 lines
Fix image interpolation edges for Agg 2.4. It no longer needs funny
workarounds with memory copies to interpolate the edges of the image correctly.
................
r4569 | mdboom | 2007-12-03 14:16:17 -0500 (Mon, 03 Dec 2007) | 2 lines
Fix exception when a particular contour doesn't exist.
................
r4577 | mdboom | 2007-12-04 11:01:06 -0500 (Tue, 04 Dec 2007) | 2 lines
Fix bug when collection is empty.
................
r4578 | mdboom | 2007-12-04 11:06:20 -0500 (Tue, 04 Dec 2007) | 1 line
Oops in last commit
................
r4590 | mdboom | 2007-12-04 15:06:45 -0500 (Tue, 04 Dec 2007) | 2 lines
Bugfix for missing markers. Bugfix for faceted pcolor-based quadmeshes.
................
r4591 | mdboom | 2007-12-04 15:07:31 -0500 (Tue, 04 Dec 2007) | 2 lines
Bugfix for faceted pcolor-based quadmeshes.
................
r4592 | mdboom | 2007-12-04 15:07:59 -0500 (Tue, 04 Dec 2007) | 2 lines
Bugfix for broken_barh demo
................
r4593 | mdboom | 2007-12-04 15:08:28 -0500 (Tue, 04 Dec 2007) | 2 lines
Fix direction of left and right caret markers.
................
r4594 | mdboom | 2007-12-04 15:28:24 -0500 (Tue, 04 Dec 2007) | 2 lines
Fix bbox_artist
................
r4595 | mdboom | 2007-12-04 15:29:54 -0500 (Tue, 04 Dec 2007) | 2 lines
Fix interpolation so it wraps rather than clips.
................
r4600 | mdboom | 2007-12-04 15:55:04 -0500 (Tue, 04 Dec 2007) | 2 lines
Fix inverted x-axis bug.
................
r4602 | mdboom | 2007-12-04 16:30:06 -0500 (Tue, 04 Dec 2007) | 2 lines
Bugfix.
................
r4603 | mdboom | 2007-12-04 16:33:33 -0500 (Tue, 04 Dec 2007) | 3 lines
Add experimental support for auto-layout of axes on the figure, to
prevent ticks and labels from overlapping things in other axes.
................
r4604 | mdboom | 2007-12-04 16:53:43 -0500 (Tue, 04 Dec 2007) | 2 lines
Fix xlabel on top axes to say what it is.
................
r4615 | mdboom | 2007-12-05 10:36:48 -0500 (Wed, 05 Dec 2007) | 3 lines
Make new auto-layout stuff optional (so it can be experimented on
without breaking too much.)
................
r4624 | mdboom | 2007-12-05 13:14:38 -0500 (Wed, 05 Dec 2007) | 2 lines
Make autolayout a configuration option.
................
r4625 | mdboom | 2007-12-05 13:56:18 -0500 (Wed, 05 Dec 2007) | 2 lines
Make things more robust to changes in dpi.
................
r4626 | mdboom | 2007-12-05 13:56:42 -0500 (Wed, 05 Dec 2007) | 2 lines
Avoid matching widths and heights too often.
................
r4627 | mdboom | 2007-12-05 13:57:06 -0500 (Wed, 05 Dec 2007) | 2 lines
Prevent mathtext cache from getting out of hand.
................
r4628 | mdboom | 2007-12-05 13:57:54 -0500 (Wed, 05 Dec 2007) | 2 lines
Remove dead code.
................
r4641 | mdboom | 2007-12-06 08:37:29 -0500 (Thu, 06 Dec 2007) | 2 lines
Fix backward-compatibility breakage of apply_aspect.
................
r4642 | mdboom | 2007-12-06 09:55:01 -0500 (Thu, 06 Dec 2007) | 2 lines
Revert examples to work best without auto-layout.
................
r4646 | mdboom | 2007-12-06 12:09:53 -0500 (Thu, 06 Dec 2007) | 2 lines
Fix an incorrect merge from trunk.
................
r4652 | mdboom | 2007-12-06 13:49:35 -0500 (Thu, 06 Dec 2007) | 2 lines
Making note about broken ...
[truncated message content] |
|
From: <md...@us...> - 2008-01-09 21:27:49
|
Revision: 4833
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4833&view=rev
Author: mdboom
Date: 2008-01-09 13:27:48 -0800 (Wed, 09 Jan 2008)
Log Message:
-----------
Handle NaNs in the data (on-the-fly as it's drawn).
Add a nan_test.py example to help ensure this stays working.
Modified Paths:
--------------
trunk/matplotlib/examples/backend_driver.py
trunk/matplotlib/lib/matplotlib/path.py
trunk/matplotlib/src/agg_py_path_iterator.h
Added Paths:
-----------
trunk/matplotlib/examples/nan_test.py
Modified: trunk/matplotlib/examples/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/backend_driver.py 2008-01-09 19:35:54 UTC (rev 4832)
+++ trunk/matplotlib/examples/backend_driver.py 2008-01-09 21:27:48 UTC (rev 4833)
@@ -71,6 +71,7 @@
'mathtext_demo.py',
'mri_with_eeg.py',
'multiple_figs_demo.py',
+ 'nan_test.py',
'pcolor_demo.py',
'pcolor_demo2.py',
'pcolor_small.py',
Added: trunk/matplotlib/examples/nan_test.py
===================================================================
--- trunk/matplotlib/examples/nan_test.py (rev 0)
+++ trunk/matplotlib/examples/nan_test.py 2008-01-09 21:27:48 UTC (rev 4833)
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+"""
+Example: simple line plot with NaNs inserted.
+"""
+from pylab import *
+
+t = arange(0.0, 1.0+0.01, 0.01)
+s = cos(2*2*pi*t)
+t[41:60] = NaN
+plot(t, s, '-', lw=2)
+
+xlabel('time (s)')
+ylabel('voltage (mV)')
+title('A sine wave with a gap of NaN\'s between 0.4 and 0.6')
+grid(True)
+
+#savefig('simple_plot.png')
+savefig('nan_test')
+
+show()
Property changes on: trunk/matplotlib/examples/nan_test.py
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2008-01-09 19:35:54 UTC (rev 4832)
+++ trunk/matplotlib/lib/matplotlib/path.py 2008-01-09 21:27:48 UTC (rev 4833)
@@ -93,8 +93,10 @@
correct places to jump over the masked regions.
"""
if ma.isMaskedArray(vertices):
+ is_mask = True
mask = ma.getmask(vertices)
else:
+ is_mask = False
vertices = npy.asarray(vertices, npy.float_)
mask = ma.nomask
@@ -108,17 +110,21 @@
# itself), are not expected to deal with masked arrays, so we
# must remove them from the array (using compressed), and add
# MOVETO commands to the codes array accordingly.
- if mask is not ma.nomask:
- mask1d = ma.mask_or(mask[:, 0], mask[:, 1])
- if codes is None:
- codes = self.LINETO * npy.ones(
- len(vertices), self.code_type)
- codes[0] = self.MOVETO
- vertices = ma.compress(npy.invert(mask1d), vertices, 0)
- codes = npy.where(npy.concatenate((mask1d[-1:], mask1d[:-1])),
- self.MOVETO, codes)
- codes = ma.masked_array(codes, mask=mask1d).compressed()
- codes = npy.asarray(codes, self.code_type)
+ if is_mask:
+ if mask is not ma.nomask:
+ mask1d = ma.mask_or(mask[:, 0], mask[:, 1])
+ if codes is None:
+ codes = self.LINETO * npy.ones(
+ len(vertices), self.code_type)
+ codes[0] = self.MOVETO
+ vertices = ma.compress(npy.invert(mask1d), vertices, 0)
+ vertices = npy.asarray(vertices)
+ codes = npy.where(npy.concatenate((mask1d[-1:], mask1d[:-1])),
+ self.MOVETO, codes)
+ codes = ma.masked_array(codes, mask=mask1d).compressed()
+ codes = npy.asarray(codes, self.code_type)
+ else:
+ vertices = npy.asarray(vertices, npy.float_)
assert vertices.ndim == 2
assert vertices.shape[1] == 2
@@ -161,8 +167,13 @@
Iterates over all of the curve segments in the path.
"""
vertices = self.vertices
+ if not len(vertices):
+ return
+
codes = self.codes
len_vertices = len(vertices)
+ isnan = npy.isnan
+ any = npy.any
NUM_VERTICES = self.NUM_VERTICES
MOVETO = self.MOVETO
@@ -170,15 +181,17 @@
CLOSEPOLY = self.CLOSEPOLY
STOP = self.STOP
- if not len(vertices):
- return
-
if codes is None:
- yield vertices[0], MOVETO
- for v in vertices[1:]:
- yield v, LINETO
+ next_code = MOVETO
+ for v in vertices:
+ if any(isnan(v)):
+ next_code = MOVETO
+ else:
+ yield v, next_code
+ next_code = LINETO
else:
i = 0
+ was_nan = False
while i < len_vertices:
code = codes[i]
if code == CLOSEPOLY:
@@ -188,7 +201,14 @@
return
else:
num_vertices = NUM_VERTICES[code]
- yield vertices[i:i+num_vertices].flatten(), code
+ curr_vertices = vertices[i:i+num_vertices].flatten()
+ if any(isnan(curr_vertices)):
+ was_nan = True
+ elif was_nan:
+ yield curr_vertices[-2:], MOVETO
+ was_nan = False
+ else:
+ yield curr_vertices, code
i += num_vertices
def transformed(self, transform):
Modified: trunk/matplotlib/src/agg_py_path_iterator.h
===================================================================
--- trunk/matplotlib/src/agg_py_path_iterator.h 2008-01-09 19:35:54 UTC (rev 4832)
+++ trunk/matplotlib/src/agg_py_path_iterator.h 2008-01-09 21:27:48 UTC (rev 4833)
@@ -5,6 +5,7 @@
#define PY_ARRAY_TYPES_PREFIX NumPy
#include "numpy/arrayobject.h"
#include "agg_path_storage.h"
+#include "MPL_isnan.h"
class PathIterator
{
@@ -64,7 +65,12 @@
inline unsigned vertex(double* x, double* y)
{
if (m_iterator >= m_total_vertices) return agg::path_cmd_stop;
- return vertex(m_iterator++, x, y);
+ unsigned code = vertex(m_iterator++, x, y);
+ while (MPL_isnan64(*x) || MPL_isnan64(*y)) {
+ vertex(m_iterator++, x, y);
+ code = agg::path_cmd_move_to;
+ }
+ return code;
}
inline void rewind(unsigned path_id)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-01-10 01:57:48
|
Revision: 4835
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4835&view=rev
Author: jdh2358
Date: 2008-01-09 17:57:45 -0800 (Wed, 09 Jan 2008)
Log Message:
-----------
bumped the svn __version__ number
Modified Paths:
--------------
trunk/matplotlib/MIGRATION.txt
trunk/matplotlib/lib/matplotlib/__init__.py
Modified: trunk/matplotlib/MIGRATION.txt
===================================================================
--- trunk/matplotlib/MIGRATION.txt 2008-01-09 21:41:49 UTC (rev 4834)
+++ trunk/matplotlib/MIGRATION.txt 2008-01-10 01:57:45 UTC (rev 4835)
@@ -29,8 +29,16 @@
> svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib
If you already have a working copy of the trunk, your next "svn up" will
-include the latest transforms changes.
+include the latest transforms changes.
+Before installing, make sure you completely remove the old matplotlib
+build and install directories, eg:
+
+ > cd matplotlib
+ > sudo rm -rf build
+ > sudo rm -rf /usr/local/lib/python2.5/site-packages/matplotlib
+ > sudo python setup.py install
+
Using the old svn code
======================
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py 2008-01-09 21:41:49 UTC (rev 4834)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-01-10 01:57:45 UTC (rev 4835)
@@ -55,7 +55,7 @@
"""
from __future__ import generators
-__version__ = '0.91.2svn'
+__version__ = '0.98pre'
__revision__ = '$Revision$'
__date__ = '$Date$'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-01-10 13:01:42
|
Revision: 4836
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4836&view=rev
Author: jswhit
Date: 2008-01-10 05:01:38 -0800 (Thu, 10 Jan 2008)
Log Message:
-----------
move toolkits to mpl_toolkits, make mpl_toolkits a namespace package.
Modified Paths:
--------------
trunk/matplotlib/API_CHANGES
trunk/matplotlib/setup.py
trunk/matplotlib/setupegg.py
Added Paths:
-----------
trunk/matplotlib/lib/mpl_toolkits/
trunk/matplotlib/lib/mpl_toolkits/__init__.py
trunk/matplotlib/lib/mpl_toolkits/exceltools.py
trunk/matplotlib/lib/mpl_toolkits/gtktools.py
Removed Paths:
-------------
trunk/matplotlib/lib/matplotlib/toolkits/
Modified: trunk/matplotlib/API_CHANGES
===================================================================
--- trunk/matplotlib/API_CHANGES 2008-01-10 01:57:45 UTC (rev 4835)
+++ trunk/matplotlib/API_CHANGES 2008-01-10 13:01:38 UTC (rev 4836)
@@ -1,3 +1,5 @@
+ toolkits must now be imported from mpl_toolkits (not matplotlib.toolkits)
+
TRANSFORMS REFACTORING
The primary goal of this refactoring was to make it easier to
Added: trunk/matplotlib/lib/mpl_toolkits/__init__.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/__init__.py (rev 0)
+++ trunk/matplotlib/lib/mpl_toolkits/__init__.py 2008-01-10 13:01:38 UTC (rev 4836)
@@ -0,0 +1,4 @@
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ pass # must not have setuptools
Added: trunk/matplotlib/lib/mpl_toolkits/exceltools.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/exceltools.py (rev 0)
+++ trunk/matplotlib/lib/mpl_toolkits/exceltools.py 2008-01-10 13:01:38 UTC (rev 4836)
@@ -0,0 +1,120 @@
+"""
+Some io tools for excel -- requires pypyExcelerator
+
+Example usage:
+
+ import matplotlib.mlab as mlab
+ import matplotlib.toolkits.exceltools as exceltools
+
+ r = mlab.csv2rec('somefile.csv', checkrows=0)
+
+ formatd = dict(
+ weight = mlab.FormatFloat(2),
+ change = mlab.FormatPercent(2),
+ cost = mlab.FormatThousands(2),
+ )
+
+
+ exceltools.rec2excel(r, 'test.xls', formatd=formatd)
+ mlab.rec2csv(r, 'test.csv', formatd=formatd)
+
+"""
+import copy
+import numpy as npy
+import pyExcelerator as excel
+import matplotlib.cbook as cbook
+import matplotlib.mlab as mlab
+
+
+def xlformat_factory(format):
+ """
+ copy the format, perform any overrides, and attach an xlstyle instance
+ copied format is returned
+ """
+ format = copy.deepcopy(format)
+
+
+
+ xlstyle = excel.XFStyle()
+ if isinstance(format, mlab.FormatPercent):
+ zeros = ''.join(['0']*format.precision)
+ xlstyle.num_format_str = '0.%s%%;[RED]-0.%s%%'%(zeros, zeros)
+ format.scale = 1.
+ elif isinstance(format, mlab.FormatFloat):
+ zeros = ''.join(['0']*format.precision)
+ xlstyle.num_format_str = '#,##0.%s;[RED]-#,##0.%s'%(zeros, zeros)
+ elif isinstance(format, mlab.FormatInt):
+ xlstyle.num_format_str = '#,##;[RED]-#,##'
+ else:
+ xlstyle = None
+
+ format.xlstyle = xlstyle
+
+ return format
+
+def rec2excel(r, ws, formatd=None, rownum=0, colnum=0):
+ """
+ save record array r to excel pyExcelerator worksheet ws
+ starting at rownum. if ws is string like, assume it is a
+ filename and save to it
+
+ start writing at rownum, colnum
+
+ formatd is a dictionary mapping dtype name -> mlab.Format instances
+
+ The next rownum after writing is returned
+ """
+
+ autosave = False
+ if cbook.is_string_like(ws):
+ filename = ws
+ wb = excel.Workbook()
+ ws = wb.add_sheet('worksheet')
+ autosave = True
+
+
+ if formatd is None:
+ formatd = dict()
+
+ formats = []
+ font = excel.Font()
+ font.bold = True
+
+ stylehdr = excel.XFStyle()
+ stylehdr.font = font
+
+ for i, name in enumerate(r.dtype.names):
+ dt = r.dtype[name]
+ format = formatd.get(name)
+ if format is None:
+ format = mlab.defaultformatd.get(dt.type, mlab.FormatObj())
+
+ format = xlformat_factory(format)
+ ws.write(rownum, colnum+i, name, stylehdr)
+ formats.append(format)
+
+ rownum+=1
+
+
+ ind = npy.arange(len(r.dtype.names))
+ for row in r:
+ for i in ind:
+ val = row[i]
+ format = formats[i]
+ val = format.toval(val)
+ if format.xlstyle is None:
+ ws.write(rownum, colnum+i, val)
+ else:
+ if mlab.safe_isnan(val):
+ ws.write(rownum, colnum+i, 'NaN')
+ else:
+ ws.write(rownum, colnum+i, val, format.xlstyle)
+ rownum += 1
+
+ if autosave:
+ wb.save(filename)
+ return rownum
+
+
+
+
Added: trunk/matplotlib/lib/mpl_toolkits/gtktools.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/gtktools.py (rev 0)
+++ trunk/matplotlib/lib/mpl_toolkits/gtktools.py 2008-01-10 13:01:38 UTC (rev 4836)
@@ -0,0 +1,299 @@
+"""
+
+Some gtk specific tools and widgets
+
+ * rec2gtk : put record array in GTK treeview - requires gtk
+
+Example usage
+
+ import matplotlib.mlab as mlab
+ import matplotlib.toolkits.gtktools as gtktools
+
+ r = mlab.csv2rec('somefile.csv', checkrows=0)
+
+ formatd = dict(
+ weight = mlab.FormatFloat(2),
+ change = mlab.FormatPercent(2),
+ cost = mlab.FormatThousands(2),
+ )
+
+
+ exceltools.rec2excel(r, 'test.xls', formatd=formatd)
+ mlab.rec2csv(r, 'test.csv', formatd=formatd)
+
+
+ import gtk
+ scroll = gtktools.rec2gtk(r, formatd=formatd)
+ win = gtk.Window()
+ win.set_size_request(600,800)
+ win.add(scroll)
+ win.show_all()
+ gtk.main()
+
+"""
+import copy
+import gtk, gobject
+import numpy as npy
+import matplotlib.cbook as cbook
+import matplotlib.mlab as mlab
+
+def gtkformat_factory(format, colnum):
+ """
+ copy the format, perform any overrides, and attach an gtk style attrs
+
+
+ xalign = 0.
+ cell = None
+
+ """
+
+ format = copy.copy(format)
+ format.xalign = 0.
+ format.cell = None
+
+ def negative_red_cell(column, cell, model, thisiter):
+ val = model.get_value(thisiter, colnum)
+ try: val = float(val)
+ except: cell.set_property('foreground', 'black')
+ else:
+ if val<0:
+ cell.set_property('foreground', 'red')
+ else:
+ cell.set_property('foreground', 'black')
+
+
+ if isinstance(format, mlab.FormatFloat) or isinstance(format, mlab.FormatInt):
+ format.cell = negative_red_cell
+ format.xalign = 1.
+ elif isinstance(format, mlab.FormatDate):
+ format.xalign = 1.
+ return format
+
+
+
+class SortedStringsScrolledWindow(gtk.ScrolledWindow):
+ """
+ A simple treeview/liststore assuming all columns are strings.
+ Supports ascending/descending sort by clicking on column header
+ """
+
+ def __init__(self, colheaders, formatterd=None):
+ """
+ xalignd if not None, is a dict mapping col header to xalignent (default 1)
+
+ formatterd if not None, is a dict mapping col header to a ColumnFormatter
+ """
+
+
+ gtk.ScrolledWindow.__init__(self)
+ self.colheaders = colheaders
+ self.seq = None # not initialized with accts
+ self.set_shadow_type(gtk.SHADOW_ETCHED_IN)
+ self.set_policy(gtk.POLICY_AUTOMATIC,
+ gtk.POLICY_AUTOMATIC)
+
+ types = [gobject.TYPE_STRING] * len(colheaders)
+ model = self.model = gtk.ListStore(*types)
+
+
+ treeview = gtk.TreeView(self.model)
+ treeview.show()
+ treeview.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
+ treeview.set_rules_hint(True)
+
+
+ class Clicked:
+ def __init__(self, parent, i):
+ self.parent = parent
+ self.i = i
+ self.num = 0
+
+ def __call__(self, column):
+ ind = []
+ dsu = []
+ for rownum, thisiter in enumerate(self.parent.iters):
+ val = model.get_value(thisiter, self.i)
+ try: val = float(val.strip().rstrip('%'))
+ except ValueError: pass
+ if npy.isnan(val): val = npy.inf # force nan to sort uniquely
+ dsu.append((val, rownum))
+ dsu.sort()
+ if not self.num%2: dsu.reverse()
+
+ vals, otherind = zip(*dsu)
+ ind.extend(otherind)
+
+ self.parent.model.reorder(ind)
+ newiters = []
+ for i in ind:
+ newiters.append(self.parent.iters[i])
+ self.parent.iters = newiters[:]
+ for i, thisiter in enumerate(self.parent.iters):
+ key = tuple([self.parent.model.get_value(thisiter, j) for j in range(len(colheaders))])
+ self.parent.rownumd[i] = key
+
+ self.num+=1
+
+
+ if formatterd is None:
+ formatterd = dict()
+
+ formatterd = formatterd.copy()
+
+ for i, header in enumerate(colheaders):
+ renderer = gtk.CellRendererText()
+ if header not in formatterd:
+ formatterd[header] = ColumnFormatter()
+ formatter = formatterd[header]
+
+ column = gtk.TreeViewColumn(header, renderer, text=i)
+ renderer.set_property('xalign', formatter.xalign)
+ column.connect('clicked', Clicked(self, i))
+ column.set_property('clickable', True)
+
+ if formatter.cell is not None:
+ column.set_cell_data_func(renderer, formatter.cell)
+
+ treeview.append_column(column)
+
+
+
+ self.formatterd = formatterd
+ self.lastcol = column
+ self.add(treeview)
+ self.treeview = treeview
+ self.clear()
+
+ def clear(self):
+ self.iterd = dict()
+ self.iters = [] # an ordered list of iters
+ self.rownumd = dict() # a map from rownum -> symbol
+ self.model.clear()
+ self.datad = dict()
+
+
+ def flat(self, row):
+ seq = []
+ for i,val in enumerate(row):
+ formatter = self.formatterd.get(self.colheaders[i])
+ seq.extend([i,formatter.tostr(val)])
+ return seq
+
+ def __delete_selected(self, *unused): # untested
+
+
+ keyd = dict([(thisiter, key) for key, thisiter in self.iterd.values()])
+ for row in self.get_selected():
+ key = tuple(row)
+ thisiter = self.iterd[key]
+ self.model.remove(thisiter)
+ del self.datad[key]
+ del self.iterd[key]
+ self.iters.remove(thisiter)
+
+ for i, thisiter in enumerate(self.iters):
+ self.rownumd[i] = keyd[thisiter]
+
+
+
+ def delete_row(self, row):
+ key = tuple(row)
+ thisiter = self.iterd[key]
+ self.model.remove(thisiter)
+
+
+ del self.datad[key]
+ del self.iterd[key]
+ self.rownumd[len(self.iters)] = key
+ self.iters.remove(thisiter)
+
+ for rownum, thiskey in self.rownumd.items():
+ if thiskey==key: del self.rownumd[rownum]
+
+ def add_row(self, row):
+ thisiter = self.model.append()
+ self.model.set(thisiter, *self.flat(row))
+ key = tuple(row)
+ self.datad[key] = row
+ self.iterd[key] = thisiter
+ self.rownumd[len(self.iters)] = key
+ self.iters.append(thisiter)
+
+ def update_row(self, rownum, newrow):
+ key = self.rownumd[rownum]
+ thisiter = self.iterd[key]
+ newkey = tuple(newrow)
+
+ self.rownumd[rownum] = newkey
+ del self.datad[key]
+ del self.iterd[key]
+ self.datad[newkey] = newrow
+ self.iterd[newkey] = thisiter
+
+
+ self.model.set(thisiter, *self.flat(newrow))
+
+ def get_row(self, rownum):
+ key = self.rownumd[rownum]
+ return self.datad[key]
+
+ def get_selected(self):
+ selected = []
+ def foreach(model, path, iter, selected):
+ selected.append(model.get_value(iter, 0))
+
+ self.treeview.get_selection().selected_foreach(foreach, selected)
+ return selected
+
+
+
+def rec2gtk(r, formatd=None, rownum=0, autowin=True):
+ """
+ save record array r to excel pyExcelerator worksheet ws
+ starting at rownum. if ws is string like, assume it is a
+ filename and save to it
+
+ formatd is a dictionary mapping dtype name -> mlab.Format instances
+
+ This function creates a SortedStringsScrolledWindow (derived
+ from gtk.ScrolledWindow) and returns it. if autowin is True,
+ a gtk.Window is created, attached to the
+ SortedStringsScrolledWindow instance, shown and returned. If
+ autowin=False, the caller is responsible for adding the
+ SortedStringsScrolledWindow instance to a gtk widget and
+ showing it.
+ """
+
+
+
+ if formatd is None:
+ formatd = dict()
+
+ formats = []
+ for i, name in enumerate(r.dtype.names):
+ dt = r.dtype[name]
+ format = formatd.get(name)
+ if format is None:
+ format = mlab.defaultformatd.get(dt.type, mlab.FormatObj())
+ #print 'gtk fmt factory', i, name, format, type(format)
+ format = gtkformat_factory(format, i)
+ formatd[name] = format
+
+
+ colheaders = r.dtype.names
+ scroll = SortedStringsScrolledWindow(colheaders, formatd)
+
+ ind = npy.arange(len(r.dtype.names))
+ for row in r:
+ scroll.add_row(row)
+
+
+ if autowin:
+ win = gtk.Window()
+ win.set_default_size(800,600)
+ win.add(scroll)
+ win.show_all()
+ scroll.win = win
+
+ return scroll
+
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2008-01-10 01:57:45 UTC (rev 4835)
+++ trunk/matplotlib/setup.py 2008-01-10 13:01:38 UTC (rev 4836)
@@ -55,7 +55,8 @@
'matplotlib',
'matplotlib.backends',
'matplotlib.projections',
- 'matplotlib.toolkits',
+# 'matplotlib.toolkits',
+ 'mpl_toolkits',
'matplotlib.numerix',
'matplotlib.numerix.mlab',
'matplotlib.numerix.ma',
Modified: trunk/matplotlib/setupegg.py
===================================================================
--- trunk/matplotlib/setupegg.py 2008-01-10 01:57:45 UTC (rev 4835)
+++ trunk/matplotlib/setupegg.py 2008-01-10 13:01:38 UTC (rev 4836)
@@ -5,4 +5,4 @@
from setuptools import setup
execfile('setup.py',
{'additional_params' :
- {'namespace_packages' : ['matplotlib.toolkits']}})
+ {'namespace_packages' : ['mpl_toolkits']}})
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-01-10 13:12:47
|
Revision: 4837
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4837&view=rev
Author: dsdale
Date: 2008-01-10 05:12:46 -0800 (Thu, 10 Jan 2008)
Log Message:
-----------
use setup.cfg to set parameters for windows installers
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/setup.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-01-10 13:01:38 UTC (rev 4836)
+++ trunk/matplotlib/CHANGELOG 2008-01-10 13:12:46 UTC (rev 4837)
@@ -1,3 +1,6 @@
+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
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py 2008-01-10 13:01:38 UTC (rev 4836)
+++ trunk/matplotlib/setup.py 2008-01-10 13:12:46 UTC (rev 4837)
@@ -236,12 +236,8 @@
print_line()
# Write the default matplotlibrc file
-if sys.platform=='win32':
- rc['backend'] = 'TkAgg'
- rc['numerix'] = 'numpy'
-else:
- if options['backend']: rc['backend'] = options['backend']
- if options['numerix']: rc['numerix'] = options['numerix']
+if options['backend']: rc['backend'] = options['backend']
+if options['numerix']: rc['numerix'] = options['numerix']
template = file('matplotlibrc.template').read()
file('lib/matplotlib/mpl-data/matplotlibrc', 'w').write(template%rc)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-01-10 13:33:11
|
Revision: 4844
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4844&view=rev
Author: mdboom
Date: 2008-01-10 05:33:03 -0800 (Thu, 10 Jan 2008)
Log Message:
-----------
Merged revisions 4826-4843 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4826 | mdboom | 2008-01-08 17:13:08 -0500 (Tue, 08 Jan 2008) | 1 line
Undoing last commit. Testing was successful.
........
r4841 | mdboom | 2008-01-10 08:28:01 -0500 (Thu, 10 Jan 2008) | 1 line
Fix offset labels (so the times symbol is displayed correctly)
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/ticker.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4816
+ /branches/v0_91_maint:1-4843
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-01-10 13:29:16 UTC (rev 4843)
+++ trunk/matplotlib/CHANGELOG 2008-01-10 13:33:03 UTC (rev 4844)
@@ -1,7 +1,7 @@
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,
+2008-01-10 Use setup.cfg to set the default parameters (tkagg,
numpy) when building windows installers - DSD
===============================================================
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py 2008-01-10 13:29:16 UTC (rev 4843)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2008-01-10 13:33:03 UTC (rev 4844)
@@ -327,12 +327,16 @@
if self.offset > 0: offsetStr = '+' + offsetStr
if self.orderOfMagnitude:
if self._usetex or self._useMathText:
- sciNotStr = r'\times'+self.format_data(10**self.orderOfMagnitude)
+ sciNotStr = self.format_data(10**self.orderOfMagnitude)
else:
- sciNotStr = u'\xd7'+'1e%d'% self.orderOfMagnitude
+ sciNotStr = '1e%d'% self.orderOfMagnitude
if self._useMathText:
- return ''.join(('$\mathdefault{',sciNotStr,offsetStr,'}$'))
+ if sciNotStr != '':
+ sciNotStr = r'\times\mathdefault{%s}' % sciNotStr
+ return ''.join(('$',sciNotStr,r'\mathdefault{',offsetStr,'}$'))
elif self._usetex:
+ if sciNotStr != '':
+ sciNotStr = u'\xd7%s' % sciNotStr
return ''.join(('$',sciNotStr,offsetStr,'$'))
else:
return ''.join((sciNotStr,offsetStr))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-01-10 16:42:34
|
Revision: 4856
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4856&view=rev
Author: mdboom
Date: 2008-01-10 08:42:31 -0800 (Thu, 10 Jan 2008)
Log Message:
-----------
Merged revisions 4844-4855 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4846 | mdboom | 2008-01-10 08:38:37 -0500 (Thu, 10 Jan 2008) | 3 lines
Merge Darren's win32 build changes to the maintenance branch (since
they'll be handy there also).
........
r4854 | mdboom | 2008-01-10 11:37:18 -0500 (Thu, 10 Jan 2008) | 2 lines
Fix display of '[' and ']' in mathtext.
........
r4855 | mdboom | 2008-01-10 11:40:54 -0500 (Thu, 10 Jan 2008) | 2 lines
Update changelog.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/mathtext.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4843
+ /branches/v0_91_maint:1-4855
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-01-10 16:40:54 UTC (rev 4855)
+++ trunk/matplotlib/CHANGELOG 2008-01-10 16:42:31 UTC (rev 4856)
@@ -4,6 +4,15 @@
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
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-01-10 16:40:54 UTC (rev 4855)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-01-10 16:42:31 UTC (rev 4856)
@@ -2057,7 +2057,7 @@
).setParseAction(self.customspace).setName('customspace')
unicode_range = u"\U00000080-\U0001ffff"
- symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()|%s])|(\\[%%${}\[\]_|])" % unicode_range)
+ symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()\[\]|%s])|(\\[%%${}\[\]_|])" % unicode_range)
| Combine(
bslash
+ oneOf(tex2uni.keys())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-01-14 13:15:21
|
Revision: 4867
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4867&view=rev
Author: mdboom
Date: 2008-01-14 05:15:17 -0800 (Mon, 14 Jan 2008)
Log Message:
-----------
Merged revisions 4856-4866 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4866 | mdboom | 2008-01-14 08:11:16 -0500 (Mon, 14 Jan 2008) | 3 lines
Fix SVG glyphs for use with Qt (which doesn't look forward for the
glyph definitions).
........
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4855
+ /branches/v0_91_maint:1-4866
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-01-14 13:11:16 UTC (rev 4866)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-01-14 13:15:17 UTC (rev 4867)
@@ -294,8 +294,20 @@
fontsize = prop.get_size_in_points()
color = rgb2hex(gc.get_rgb()[:3])
+ write = self._svgwriter.write
if rcParams['svg.embed_char_paths']:
+ new_chars = []
+ for c in s:
+ path = self._add_char_def(prop, c)
+ if path is not None:
+ new_chars.append(path)
+ if len(new_chars):
+ write('<defs>\n')
+ for path in new_chars:
+ write(path)
+ write('</defs>\n')
+
svg = ['<g style="fill: %s; opacity: %s" transform="' % (color, gc.get_alpha())]
if angle != 0:
svg.append('translate(%s,%s)rotate(%1.1f)' % (x,y,-angle))
@@ -307,7 +319,7 @@
lastgind = None
currx = 0
for c in s:
- charid = self._add_char_def(prop, c)
+ charnum = self._get_char_def_id(prop, c)
ccode = ord(c)
gind = cmap.get(ccode)
if gind is None:
@@ -322,7 +334,7 @@
lastgind = gind
currx += kern/64.0
- svg.append('<use xlink:href="#%s"' % charid)
+ svg.append('<use xlink:href="#%s"' % charnum)
if currx != 0:
svg.append(' x="%s"' %
(currx * (self.FONT_SCALE / fontsize)))
@@ -346,7 +358,7 @@
svg = """\
<text style="%(style)s" x="%(x)s" y="%(y)s" %(transform)s>%(thetext)s</text>
""" % locals()
- self._svgwriter.write (svg)
+ write(svg)
def _add_char_def(self, prop, char):
if isinstance(prop, FontProperties):
@@ -357,9 +369,9 @@
font.set_size(self.FONT_SCALE, 72)
ps_name = font.get_sfnt()[(1,0,0,6)]
char_id = urllib.quote('%s-%d' % (ps_name, ord(char)))
- char_num, path = self._char_defs.get(char_id, (None, None))
+ char_num = self._char_defs.get(char_id, None)
if char_num is not None:
- return char_num
+ return None
path_data = []
glyph = font.load_char(ord(char), flags=LOAD_NO_HINTING)
@@ -388,9 +400,20 @@
currx, curry = step[-2], -step[-1]
char_num = 'c%x' % len(self._char_defs)
path_element = '<path id="%s" d="%s"/>\n' % (char_num, ''.join(path_data))
- self._char_defs[char_id] = (char_num, path_element)
- return char_num
+ self._char_defs[char_id] = char_num
+ return path_element
+ def _get_char_def_id(self, prop, char):
+ if isinstance(prop, FontProperties):
+ newprop = prop.copy()
+ font = self._get_font(newprop)
+ else:
+ font = prop
+ font.set_size(self.FONT_SCALE, 72)
+ ps_name = font.get_sfnt()[(1,0,0,6)]
+ char_id = urllib.quote('%s-%d' % (ps_name, ord(char)))
+ return self._char_defs[char_id]
+
def _draw_mathtext(self, gc, x, y, s, prop, angle):
"""
Draw math text using matplotlib.mathtext
@@ -400,12 +423,22 @@
svg_glyphs = svg_elements.svg_glyphs
svg_rects = svg_elements.svg_rects
color = rgb2hex(gc.get_rgb()[:3])
+ write = self._svgwriter.write
- self.open_group("mathtext")
-
style = "fill: %s" % color
if rcParams['svg.embed_char_paths']:
+ new_chars = []
+ for font, fontsize, thetext, new_x, new_y_mtc, metrics in svg_glyphs:
+ path = self._add_char_def(font, thetext)
+ if path is not None:
+ new_chars.append(path)
+ if len(new_chars):
+ write('<defs>\n')
+ for path in new_chars:
+ write(path)
+ write('</defs>\n')
+
svg = ['<g style="%s" transform="' % style]
if angle != 0:
svg.append('translate(%s,%s)rotate(%1.1f)'
@@ -415,7 +448,7 @@
svg.append('">\n')
for font, fontsize, thetext, new_x, new_y_mtc, metrics in svg_glyphs:
- charid = self._add_char_def(font, thetext)
+ charid = self._get_char_def_id(font, thetext)
svg.append('<use xlink:href="#%s" transform="translate(%s,%s)scale(%s)"/>\n' %
(charid, new_x, -new_y_mtc, fontsize / self.FONT_SCALE))
@@ -469,16 +502,12 @@
svg.append('<rect x="%s" y="%s" width="%s" height="%s" fill="black" stroke="none" />' % (x, -y + height, width, height))
svg.append("</g>")
- self._svgwriter.write (''.join(svg))
+ self.open_group("mathtext")
+ write (''.join(svg))
self.close_group("mathtext")
def finalize(self):
write = self._svgwriter.write
- if len(self._char_defs):
- write('<defs id="fontpaths">\n')
- for char_num, path in self._char_defs.values():
- write(path)
- write('</defs>\n')
write('</svg>\n')
def flipy(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-01-18 14:44:44
|
Revision: 4875
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4875&view=rev
Author: mdboom
Date: 2008-01-18 06:44:10 -0800 (Fri, 18 Jan 2008)
Log Message:
-----------
Add line simplification, to cut down on the number of line segments
that need to be stroked. Affects *Agg and Gdk backends.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
trunk/matplotlib/lib/matplotlib/path.py
trunk/matplotlib/src/_backend_agg.cpp
trunk/matplotlib/src/_path.cpp
trunk/matplotlib/src/agg_py_path_iterator.h
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py 2008-01-17 04:13:27 UTC (rev 4874)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py 2008-01-18 14:44:10 UTC (rev 4875)
@@ -84,7 +84,7 @@
def draw_path(self, gc, path, transform, rgbFace=None):
transform = transform + Affine2D(). \
scale(1.0, -1.0).translate(0, self.height)
- polygons = path.to_polygons(transform)
+ polygons = path.to_polygons(transform, self.width, self.height)
for polygon in polygons:
# draw_polygon won't take an arbitrary sequence -- it must be a list
# of tuples
Modified: trunk/matplotlib/lib/matplotlib/path.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/path.py 2008-01-17 04:13:27 UTC (rev 4874)
+++ trunk/matplotlib/lib/matplotlib/path.py 2008-01-18 14:44:10 UTC (rev 4875)
@@ -283,7 +283,7 @@
new_codes = None
return Path(vertices, new_codes)
- def to_polygons(self, transform=None):
+ def to_polygons(self, transform=None, width=0, height=0):
"""
Convert this path to a list of polygons. Each polygon is an
Nx2 array of vertices. In other words, each polygon has no
@@ -292,13 +292,13 @@
if transform is not None:
transform = transform.frozen()
# Deal with the common and simple case
- if self.codes is None:
+ if self.codes is None and len(self.vertices) < 100:
if len(self.vertices):
return [transform.transform(self.vertices)]
return []
# Deal with the case where there are curves and/or multiple
# subpaths (using extension code)
- return convert_path_to_polygons(self, transform)
+ return convert_path_to_polygons(self, transform, width, height)
_unit_rectangle = None
#@classmethod
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2008-01-17 04:13:27 UTC (rev 4874)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-01-18 14:44:10 UTC (rev 4875)
@@ -20,6 +20,7 @@
#include "agg_span_image_filter_gray.h"
#include "agg_span_image_filter_rgba.h"
#include "agg_span_interpolator_linear.h"
+#include "agg_conv_shorten_path.h"
#include "util/agg_color_conv_rgb8.h"
#include "ft2font.h"
@@ -84,31 +85,6 @@
return Py::String(PyString_FromStringAndSize((const char*)data, height*stride), true);
}
-template<class VertexSource> class conv_quantize
-{
-public:
- conv_quantize(VertexSource& source, bool quantize) :
- m_source(&source), m_quantize(quantize) {}
-
- void rewind(unsigned path_id) {
- m_source->rewind(path_id);
- }
-
- unsigned vertex(double* x, double* y) {
- unsigned cmd = m_source->vertex(x, y);
- if (m_quantize && agg::is_vertex(cmd)) {
- *x = round(*x) + 0.5;
- *y = round(*y) + 0.5;
- }
- return cmd;
- }
-
-private:
- VertexSource* m_source;
- bool m_quantize;
-};
-
-
GCAgg::GCAgg(const Py::Object &gc, double dpi) :
dpi(dpi), isaa(true), linewidth(1.0), alpha(1.0),
dashOffset(0.0)
@@ -358,8 +334,8 @@
template<class Path>
bool should_snap(Path& path, const agg::trans_affine& trans) {
- // If this contains only straight horizontal or vertical lines, quantize to nearest
- // pixels
+ // If this contains only straight horizontal or vertical lines, it should be
+ // quantized to the nearest pixels
double x0, y0, x1, y1;
unsigned code;
@@ -392,6 +368,11 @@
return true;
}
+template<class Path>
+bool should_simplify(Path& path) {
+ return !path.has_curves() && path.total_vertices() > 5;
+}
+
Py::Object
RendererAgg::copy_from_bbox(const Py::Tuple& args) {
//copy region in bbox to buffer and return swig/agg buffer object
@@ -479,7 +460,7 @@
Py::Object
RendererAgg::draw_markers(const Py::Tuple& args) {
typedef agg::conv_transform<PathIterator> transformed_path_t;
- typedef conv_quantize<transformed_path_t> quantize_t;
+ typedef SimplifyPath<transformed_path_t> simplify_t;
typedef agg::conv_curve<transformed_path_t> curve_t;
typedef agg::conv_stroke<curve_t> stroke_t;
typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type;
@@ -510,8 +491,8 @@
bool snap = should_snap(path, trans);
transformed_path_t path_transformed(path, trans);
GCAgg gc = GCAgg(gc_obj, dpi);
- quantize_t path_quantized(path_transformed, snap);
- path_quantized.rewind(0);
+ simplify_t path_simplified(path_transformed, snap, false, width, height);
+ path_simplified.rewind(0);
facepair_t face = _get_rgba_face(face_obj, gc.alpha);
@@ -564,7 +545,7 @@
agg::serialized_scanlines_adaptor_aa8::embedded_scanline sl;
if (has_clippath) {
- while (path_quantized.vertex(&x, &y) != agg::path_cmd_stop) {
+ while (path_simplified.vertex(&x, &y) != agg::path_cmd_stop) {
pixfmt_amask_type pfa(*pixFmt, *alphaMask);
amask_ren_type r(pfa);
amask_aa_renderer_type ren(r);
@@ -579,7 +560,7 @@
agg::render_scanlines(sa, sl, ren);
}
} else {
- while (path_quantized.vertex(&x, &y) != agg::path_cmd_stop) {
+ while (path_simplified.vertex(&x, &y) != agg::path_cmd_stop) {
if (face.first) {
rendererAA->color(face.second);
sa.init(fillCache, fillSize, x, y);
@@ -881,8 +862,8 @@
Py::Object
RendererAgg::draw_path(const Py::Tuple& args) {
typedef agg::conv_transform<PathIterator> transformed_path_t;
- typedef conv_quantize<transformed_path_t> quantize_t;
- typedef agg::conv_curve<quantize_t> curve_t;
+ typedef SimplifyPath<transformed_path_t> simplify_t;
+ typedef agg::conv_curve<simplify_t> curve_t;
_VERBOSE("RendererAgg::draw_path");
args.verify_length(3, 4);
@@ -906,9 +887,11 @@
trans *= agg::trans_affine_scaling(1.0, -1.0);
trans *= agg::trans_affine_translation(0.0, (double)height);
bool snap = should_snap(path, trans);
+ bool simplify = should_simplify(path);
+
transformed_path_t tpath(path, trans);
- quantize_t quantized(tpath, snap);
- curve_t curve(quantized);
+ simplify_t simplified(tpath, snap, simplify, width, height);
+ curve_t curve(simplified);
if (snap)
gc.isaa = false;
@@ -934,8 +917,8 @@
const Py::SeqBase<Py::Object>& linestyles_obj,
const Py::SeqBase<Py::Int>& antialiaseds) {
typedef agg::conv_transform<typename PathGenerator::path_iterator> transformed_path_t;
- typedef conv_quantize<transformed_path_t> quantize_t;
- typedef agg::conv_curve<quantize_t> quantized_curve_t;
+ typedef SimplifyPath<transformed_path_t> simplify_t;
+ typedef agg::conv_curve<simplify_t> simplified_curve_t;
typedef agg::conv_curve<transformed_path_t> curve_t;
GCAgg gc(dpi);
@@ -1068,12 +1051,12 @@
gc.isaa = bool(Py::Int(antialiaseds[i % Naa]));
transformed_path_t tpath(path, trans);
- quantize_t quantized(tpath, snap);
+ simplify_t simplified(tpath, snap, false, width, height);
if (has_curves) {
- quantized_curve_t curve(quantized);
+ simplified_curve_t curve(simplified);
_draw_path(curve, has_clippath, face, gc);
} else {
- _draw_path(quantized, has_clippath, face, gc);
+ _draw_path(simplified, has_clippath, face, gc);
}
} else {
gc.isaa = bool(Py::Int(antialiaseds[i % Naa]));
Modified: trunk/matplotlib/src/_path.cpp
===================================================================
--- trunk/matplotlib/src/_path.cpp 2008-01-17 04:13:27 UTC (rev 4874)
+++ trunk/matplotlib/src/_path.cpp 2008-01-18 14:44:10 UTC (rev 4875)
@@ -1102,17 +1102,23 @@
Py::Object _path_module::convert_path_to_polygons(const Py::Tuple& args)
{
typedef agg::conv_transform<PathIterator> transformed_path_t;
- typedef agg::conv_curve<transformed_path_t> curve_t;
+ typedef SimplifyPath<transformed_path_t> simplify_t;
+ typedef agg::conv_curve<simplify_t> curve_t;
typedef std::vector<double> vertices_t;
- args.verify_length(2);
+ args.verify_length(4);
PathIterator path(args[0]);
agg::trans_affine trans = py_to_agg_transformation_matrix(args[1], false);
+ double width = Py::Float(args[2]);
+ double height = Py::Float(args[3]);
+ bool simplify = !path.has_curves();
+
transformed_path_t tpath(path, trans);
- curve_t curve(tpath);
+ simplify_t simplified(tpath, false, simplify, width, height);
+ curve_t curve(simplified);
Py::List polygons;
vertices_t polygon;
Modified: trunk/matplotlib/src/agg_py_path_iterator.h
===================================================================
--- trunk/matplotlib/src/agg_py_path_iterator.h 2008-01-17 04:13:27 UTC (rev 4874)
+++ trunk/matplotlib/src/agg_py_path_iterator.h 2008-01-18 14:44:10 UTC (rev 4875)
@@ -6,6 +6,7 @@
#include "numpy/arrayobject.h"
#include "agg_path_storage.h"
#include "MPL_isnan.h"
+#include <deque>
class PathIterator
{
@@ -46,11 +47,16 @@
static const unsigned code_map[];
private:
- inline unsigned vertex(unsigned idx, double* x, double* y)
+ inline void vertex(const unsigned idx, double* x, double* y)
{
char* pair = (char*)PyArray_GETPTR2(m_vertices, idx, 0);
*x = *(double*)pair;
*y = *(double*)(pair + PyArray_STRIDE(m_vertices, 1));
+ }
+
+ inline unsigned vertex_with_code(const unsigned idx, double* x, double* y)
+ {
+ vertex(idx, x, y);
if (m_codes)
{
return code_map[(int)*(char *)PyArray_GETPTR1(m_codes, idx)];
@@ -65,11 +71,12 @@
inline unsigned vertex(double* x, double* y)
{
if (m_iterator >= m_total_vertices) return agg::path_cmd_stop;
- unsigned code = vertex(m_iterator++, x, y);
+ unsigned code = vertex_with_code(m_iterator++, x, y);
while ((MPL_isnan64(*x) || MPL_isnan64(*y)) &&
- m_iterator < m_total_vertices) {
- vertex(m_iterator++, x, y);
- code = agg::path_cmd_move_to;
+ m_iterator < m_total_vertices)
+ {
+ vertex(m_iterator++, x, y);
+ code = agg::path_cmd_move_to;
}
return code;
}
@@ -100,4 +107,368 @@
agg::path_cmd_end_poly | agg::path_flags_close
};
+#define DEBUG_SIMPLIFY 0
+
+template<class VertexSource>
+class SimplifyPath
+{
+public:
+ SimplifyPath(VertexSource& source, bool quantize, bool simplify,
+ double width = 0.0, double height = 0.0) :
+ m_source(&source), m_quantize(quantize), m_simplify(simplify),
+ m_width(width), m_height(height),
+ m_moveto(true), m_lastx(0.0), m_lasty(0.0), m_clipped(false),
+ m_do_clipping(width > 0.0 && height > 0.0),
+ m_origdx(0.0), m_origdy(0.0),
+ m_origdNorm2(0.0), m_dnorm2Max(0.0), m_dnorm2Min(0.0),
+ m_haveMin(false), m_lastMax(false), m_maxX(0.0), m_maxY(0.0),
+ m_minX(0.0), m_minY(0.0), m_lastWrittenX(0.0), m_lastWrittenY(0.0),
+ m_done(false)
+#if DEBUG_SIMPLIFY
+ , m_pushed(0), m_skipped(0)
+#endif
+ {
+ // empty
+ }
+
+#if DEBUG_SIMPLIFY
+ ~SimplifyPath()
+ {
+ printf("%d %d\n", m_pushed, m_skipped);
+ }
+#endif
+
+ void rewind(unsigned path_id)
+ {
+ m_source->rewind(path_id);
+ }
+
+ unsigned vertex(double* x, double* y)
+ {
+ unsigned cmd;
+
+ // The simplification algorithm doesn't support curves or compound paths
+ // so we just don't do it at all in that case...
+ if (!m_simplify)
+ {
+ cmd = m_source->vertex(x, y);
+ if (m_quantize && agg::is_vertex(cmd))
+ {
+ *x = round(*x) + 0.5;
+ *y = round(*y) + 0.5;
+ }
+ return cmd;
+ }
+
+ //idea: we can skip drawing many lines: lines < 1 pixel in length, lines
+ //outside of the drawing area, and we can combine sequential parallel lines
+ //into a single line instead of redrawing lines over the same points.
+ //The loop below works a bit like a state machine, where what it does depends
+ //on what it did in the last looping. To test whether sequential lines
+ //are close to parallel, I calculate the distance moved perpendicular to the
+ //last line. Once it gets too big, the lines cannot be combined.
+
+ // This code was originally written by someone else (John Hunter?) and I
+ // have modified to work in-place -- meaning not creating an entirely
+ // new path list each time. In order to do that without too much
+ // additional code complexity, it keeps a small queue around so that
+ // multiple points can be emitted in a single call, and those points
+ // will be popped from the queue in subsequent calls. The following
+ // block will empty the queue before proceeding to the main loop below.
+ if (m_queue.size())
+ {
+ const item& front = m_queue.front();
+ unsigned cmd = front.cmd;
+ *x = front.x;
+ *y = front.y;
+ m_queue.pop_front();
+ return cmd;
+ }
+
+ // If the queue is now empty, and the path was fully consumed
+ // in the last call to the main loop, return agg::path_cmd_stop to
+ // signal that there are no more points to emit.
+ if (m_done)
+ return agg::path_cmd_stop;
+
+ // The main simplification loop. The point is consume only as many
+ // points as necessary until some have been added to the outbound
+ // queue, not to run through the entire path in one go. This
+ // eliminates the need to allocate and fill an entire additional path
+ // array on each draw.
+ while ((cmd = m_source->vertex(x, y)) != agg::path_cmd_stop)
+ {
+ // Do any quantization if requested
+ if (m_quantize && agg::is_vertex(cmd))
+ {
+ *x = round(*x) + 0.5;
+ *y = round(*y) + 0.5;
+ }
+
+ //if we are starting a new path segment, move to the first point
+ // + init
+ if (m_moveto)
+ {
+ m_queue.push_back(item(agg::path_cmd_move_to, *x, *y));
+ m_lastx = *x;
+ m_lasty = *y;
+ m_moveto = false;
+ m_origdNorm2 = 0.0;
+#if DEBUG_SIMPLIFY
+ m_pushed++;
+#endif
+ break;
+ }
+
+ // Don't render line segments less than one pixel long
+ if (fabs(*x - m_lastx) < 1.0 && fabs(*y - m_lasty) < 1.0)
+ {
+#if DEBUG_SIMPLIFY
+ m_skipped++;
+#endif
+ continue;
+ }
+
+ //skip any lines that are outside the drawing area. Note: More lines
+ //could be clipped, but a more involved calculation would be needed
+ if (m_do_clipping &&
+ ((*x < -1 && m_lastx < -1) ||
+ (*x > m_width + 1 && m_lastx > m_width + 1) ||
+ (*y < -1 && m_lasty < -1) ||
+ (*y > m_height + 1 && m_lasty > m_height + 1)))
+ {
+ m_lastx = *x;
+ m_lasty = *y;
+ m_clipped = true;
+ continue;
+ }
+
+ // if we have no orig vector, set it to this vector and
+ // continue.
+ // this orig vector is the reference vector we will build
+ // up the line to
+
+ if (m_origdNorm2 == 0)
+ {
+ if (m_clipped)
+ {
+ m_queue.push_back(item(agg::path_cmd_move_to, m_lastx, m_lasty));
+ m_clipped = false;
+ }
+
+ m_origdx = *x - m_lastx;
+ m_origdy = *y - m_lasty;
+ m_origdNorm2 = m_origdx*m_origdx + m_origdy+m_origdy;
+
+ //set all the variables to reflect this new orig vecor
+ m_dnorm2Max = m_origdNorm2;
+ m_dnorm2Min = 0;
+ m_haveMin = false;
+ m_lastMax = true;
+
+ m_maxX = *x;
+ m_maxY = *y;
+ m_minX = m_lastx;
+ m_minY = m_lasty;
+
+ m_lastWrittenX = m_lastx;
+ m_lastWrittenY = m_lasty;
+
+ // set the last point seen
+ m_lastx = *x;
+ m_lasty = *y;
+ continue;
+ }
+
+ //if got to here, then we have an orig vector and we just got
+ //a vector in the sequence.
+
+ //check that the perpendicular distance we have moved from the
+ //last written point compared to the line we are building is not too
+ //much. If o is the orig vector (we are building on), and v is the
+ //vector from the last written point to the current point, then the
+ //perpendicular vector is p = v - (o.v)o, and we normalize o (by
+ //dividing the second term by o.o).
+
+ // get the v vector
+ double totdx = *x - m_lastWrittenX;
+ double totdy = *y - m_lastWrittenY;
+ double totdot = m_origdx*totdx + m_origdy*totdy;
+
+ // get the para vector ( = (o.v)o/(o.o))
+ double paradx = totdot*m_origdx/m_origdNorm2;
+ double parady = totdot*m_origdy/m_origdNorm2;
+ double paradNorm2 = paradx*paradx + parady*parady;
+
+ // get the perp vector ( = v - para)
+ double perpdx = totdx - paradx;
+ double perpdy = totdy - parady;
+ double perpdNorm2 = perpdx*perpdx + perpdy*perpdy;
+
+ //if the perp vector is less than some number of (squared)
+ //pixels in size, then merge the current vector
+ if (perpdNorm2 < 0.25)
+ {
+ //check if the current vector is parallel or
+ //anti-parallel to the orig vector. If it is parallel, test
+ //if it is the longest of the vectors we are merging in that
+ //direction. If anti-p, test if it is the longest in the
+ //opposite direction (the min of our final line)
+
+ m_lastMax = false;
+ if (totdot >= 0)
+ {
+ if (paradNorm2 > m_dnorm2Max)
+ {
+ m_lastMax = true;
+ m_dnorm2Max = paradNorm2;
+ m_maxX = m_lastWrittenX + paradx;
+ m_maxY = m_lastWrittenY + parady;
+ }
+ }
+ else
+ {
+ m_haveMin = true;
+ if (paradNorm2 > m_dnorm2Min)
+ {
+ m_dnorm2Min = paradNorm2;
+ m_minX = m_lastWrittenX + paradx;
+ m_minY = m_lastWrittenY + parady;
+ }
+ }
+
+ m_lastx = *x;
+ m_lasty = *y;
+ continue;
+ }
+
+ //if we get here, then this vector was not similar enough to the
+ //line we are building, so we need to draw that line and start the
+ //next one.
+
+ //if the line needs to extend in the opposite direction from the
+ //direction we are drawing in, move back to we start drawing from
+ //back there.
+ if (m_haveMin)
+ m_queue.push_back(item(agg::path_cmd_line_to, m_minX, m_minY));
+ m_queue.push_back(item(agg::path_cmd_line_to, m_maxX, m_maxY));
+
+ //if we clipped some segments between this line and the next line
+ //we are starting, we also need to move to the last point.
+ if (m_clipped)
+ {
+ m_queue.push_back(item(agg::path_cmd_move_to, m_lastx, m_lasty));
+ }
+ else if (!m_lastMax)
+ {
+ //if the last line was not the longest line, then move back to
+ //the end point of the last line in the sequence. Only do this
+ //if not clipped, since in that case lastx,lasty is not part of
+ //the line just drawn.
+
+ //Would be move_to if not for the artifacts
+ m_queue.push_back(item(agg::path_cmd_line_to, m_lastx, m_lasty));
+ }
+
+ //now reset all the variables to get ready for the next line
+
+ m_origdx = *x - m_lastx;
+ m_origdy = *y - m_lasty;
+ m_origdNorm2 = m_origdx*m_origdx + m_origdy*m_origdy;
+
+ m_dnorm2Max = m_origdNorm2;
+ m_dnorm2Min = 0;
+ m_haveMin = false;
+ m_lastMax = true;
+ m_maxX = *x;
+ m_maxY = *y;
+ m_minX = m_lastx;
+ m_minY = m_lasty;
+
+ m_lastWrittenX = m_lastx;
+ m_lastWrittenY = m_lasty;
+
+ m_clipped = false;
+
+ m_lastx = *x;
+ m_lasty = *y;
+#if DEBUG_SIMPLIFY
+ m_pushed++;
+#endif
+ break;
+ }
+
+ // Fill the queue with the remaining vertices if we've finished the
+ // path in the above loop. Mark the path as done, so we don't call
+ // m_source->vertex again and segfault.
+ if (cmd == agg::path_cmd_stop)
+ {
+ if (m_origdNorm2 != 0)
+ {
+ if (m_haveMin)
+ m_queue.push_back(item(agg::path_cmd_line_to, m_minX, m_minY));
+ m_queue.push_back(item(agg::path_cmd_line_to, m_maxX, m_maxY));
+ }
+ m_done = true;
+ }
+
+ // Return the first item in the queue, if any, otherwise
+ // indicate that we're done.
+ if (m_queue.size())
+ {
+ const item& front = m_queue.front();
+ unsigned cmd = front.cmd;
+ *x = front.x;
+ *y = front.y;
+ m_queue.pop_front();
+ return cmd;
+ }
+ else
+ {
+ return agg::path_cmd_stop;
+ }
+ }
+
+private:
+ VertexSource* m_source;
+ bool m_quantize;
+ bool m_simplify;
+ double m_width, m_height;
+
+ struct item
+ {
+ item(unsigned cmd_, const double& x_, double& y_) :
+ cmd(cmd_), x(x_), y(y_) {}
+ unsigned cmd;
+ double x;
+ double y;
+ };
+ typedef std::deque<item> ItemQueue;
+ ItemQueue m_queue;
+ bool m_moveto;
+ double m_lastx, m_lasty;
+ bool m_clipped;
+ bool m_do_clipping;
+
+ double m_origdx;
+ double m_origdy;
+ double m_origdNorm2;
+ double m_dnorm2Max;
+ double m_dnorm2Min;
+ bool m_haveMin;
+ bool m_lastMax;
+ double m_maxX;
+ double m_maxY;
+ double m_minX;
+ double m_minY;
+ double m_lastWrittenX;
+ double m_lastWrittenY;
+ bool m_done;
+
+#if DEBUG_SIMPLIFY
+ unsigned m_pushed;
+ unsigned m_skipped;
+#endif
+};
+
#endif // __AGG_PY_PATH_ITERATOR_H__
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-01-18 17:30:57
|
Revision: 4877
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4877&view=rev
Author: mdboom
Date: 2008-01-18 09:27:35 -0800 (Fri, 18 Jan 2008)
Log Message:
-----------
Fix lasso_demo.py
Modified Paths:
--------------
trunk/matplotlib/examples/lasso_demo.py
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/examples/lasso_demo.py
===================================================================
--- trunk/matplotlib/examples/lasso_demo.py 2008-01-18 15:04:52 UTC (rev 4876)
+++ trunk/matplotlib/examples/lasso_demo.py 2008-01-18 17:27:35 UTC (rev 4877)
@@ -35,12 +35,12 @@
self.Nxy = len(data)
- self.facecolors = [d.color for d in data]
+ facecolors = [d.color for d in data]
self.xys = [(d.x, d.y) for d in data]
self.collection = RegularPolyCollection(
fig.dpi, 6, sizes=(100,),
- facecolors=self.facecolors,
+ facecolors=facecolors,
offsets = self.xys,
transOffset = ax.transData)
@@ -49,12 +49,13 @@
self.cid = self.canvas.mpl_connect('button_press_event', self.onpress)
def callback(self, verts):
+ facecolors = self.collection.get_facecolors()
ind = nonzero(points_inside_poly(self.xys, verts))[0]
for i in range(self.Nxy):
if i in ind:
- self.facecolors[i] = Datum.colorin
+ facecolors[i] = Datum.colorin
else:
- self.facecolors[i] = Datum.colorout
+ facecolors[i] = Datum.colorout
self.canvas.draw_idle()
self.canvas.widgetlock.release(self.lasso)
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-01-18 15:04:52 UTC (rev 4876)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-01-18 17:27:35 UTC (rev 4877)
@@ -275,6 +275,10 @@
set_facecolors = set_facecolor
+ def get_facecolor(self):
+ return self._facecolors
+ get_facecolors = get_facecolor
+
def set_edgecolor(self, c):
"""
Set the edgecolor(s) of the collection. c can be a matplotlib color
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-01-27 15:17:44
|
Revision: 4901
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4901&view=rev
Author: dsdale
Date: 2008-01-27 07:17:28 -0800 (Sun, 27 Jan 2008)
Log Message:
-----------
backend_qt4 improvements, see bug 1288848
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-01-26 13:22:33 UTC (rev 4900)
+++ trunk/matplotlib/CHANGELOG 2008-01-27 15:17:28 UTC (rev 4901)
@@ -1,3 +1,7 @@
+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
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-01-26 13:22:33 UTC (rev 4900)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-01-27 15:17:28 UTC (rev 4901)
@@ -195,9 +195,6 @@
image = os.path.join( matplotlib.rcParams['datapath'],'images','matplotlib.png' )
self.window.setWindowIcon(QtGui.QIcon( image ))
- centralWidget = QtGui.QWidget( self.window )
- self.canvas.setParent( centralWidget )
-
# Give the keyboard focus to the figure instead of the manager
self.canvas.setFocusPolicy( QtCore.Qt.ClickFocus )
self.canvas.setFocus()
@@ -206,31 +203,13 @@
self._widgetclosed )
self.window._destroying = False
- self.toolbar = self._get_toolbar(self.canvas, centralWidget)
+ self.toolbar = self._get_toolbar(self.canvas, self.window)
+ self.window.addToolBar(self.toolbar)
+ QtCore.QObject.connect(self.toolbar, QtCore.SIGNAL("message"),
+ self.window.statusBar().showMessage)
- # Use a vertical layout for the plot and the toolbar. Set the
- # stretch to all be in the plot so the toolbar doesn't resize.
- layout = QtGui.QVBoxLayout( centralWidget )
- layout.setMargin( 0 )
- layout.addWidget( self.canvas, 1 )
- if self.toolbar:
- layout.addWidget( self.toolbar, 0 )
+ self.window.setCentralWidget(self.canvas)
- self.window.setCentralWidget( centralWidget )
-
- # Reset the window height so the canvas will be the right
- # size. This ALMOST works right. The first issue is that the
- # reported toolbar height does not include the margin (so
- # we add the margin). The second is that the total width/height
- # is slightly smaller that we actually want. It seems like
- # the border of the window is being included in the size but
- # AFAIK there is no way to get that size.
- w = self.canvas.width()
- h = self.canvas.height()
- if self.toolbar:
- h += self.toolbar.height() + NavigationToolbar2QT.margin
- self.window.resize( w, h )
-
if matplotlib.is_interactive():
self.window.show()
@@ -251,9 +230,9 @@
# must be inited after the window, drawingArea and figure
# attrs are set
if matplotlib.rcParams['toolbar'] == 'classic':
- print "Classic toolbar is not yet supported"
+ print "Classic toolbar is not supported"
elif matplotlib.rcParams['toolbar'] == 'toolbar2':
- toolbar = NavigationToolbar2QT(canvas, parent)
+ toolbar = NavigationToolbar2QT(canvas, parent, False)
else:
toolbar = None
return toolbar
@@ -274,68 +253,53 @@
def set_window_title(self, title):
self.window.setWindowTitle(title)
-class NavigationToolbar2QT( NavigationToolbar2, QtGui.QWidget ):
- # list of toolitems to add to the toolbar, format is:
- # text, tooltip_text, image_file, callback(str)
- toolitems = (
- ('Home', 'Reset original view', 'home.ppm', 'home'),
- ('Back', 'Back to previous view','back.ppm', 'back'),
- ('Forward', 'Forward to next view','forward.ppm', 'forward'),
- (None, None, None, None),
- ('Pan', 'Pan axes with left mouse, zoom with right', 'move.ppm', 'pan'),
- ('Zoom', 'Zoom to rectangle','zoom_to_rect.ppm', 'zoom'),
- (None, None, None, None),
- ('Subplots', 'Configure subplots','subplots.png', 'configure_subplots'),
- ('Save', 'Save the figure','filesave.ppm', 'save_figure'),
- )
-
- margin = 12 # extra margin for the toolbar
-
- def __init__(self, canvas, parent):
+class NavigationToolbar2QT( NavigationToolbar2, QtGui.QToolBar ):
+ def __init__(self, canvas, parent, coordinates=True):
+ """ coordinates: should we show the coordinates on the right? """
self.canvas = canvas
- QtGui.QWidget.__init__( self, parent )
-
- # Layout toolbar buttons horizontally.
- self.layout = QtGui.QHBoxLayout( self )
- self.layout.setMargin( 2 )
- self.layout.setSpacing( 0 )
-
+ self.coordinates = coordinates
+ QtGui.QToolBar.__init__( self, parent )
NavigationToolbar2.__init__( self, canvas )
- def _init_toolbar( self ):
- basedir = os.path.join(matplotlib.rcParams[ 'datapath' ],'images')
- self.buttons = {}
+ def _icon(self, name):
+ return QtGui.QIcon(os.path.join(self.basedir, name))
- for text, tooltip_text, image_file, callback in self.toolitems:
- if text == None:
- self.layout.addSpacing( 8 )
- continue
+ def _init_toolbar(self):
+ self.basedir = os.path.join(matplotlib.rcParams[ 'datapath' ],'images')
- fname = os.path.join( basedir, image_file )
- image = QtGui.QPixmap()
- image.load( fname )
+ a = self.addAction(self._icon('home.svg'), 'Home', self.home)
+ a.setToolTip('Reset original view')
+ a = self.addAction(self._icon('back.svg'), 'Back', self.back)
+ a.setToolTip('Back to previous view')
+ a = self.addAction(self._icon('forward.svg'), 'Forward', self.forward)
+ a.setToolTip('Forward to next view')
+ self.addSeparator()
+ a = self.addAction(self._icon('move.svg'), 'Pan', self.pan)
+ a.setToolTip('Pan axes with left mouse, zoom with right')
+ a = self.addAction(self._icon('zoom_to_rect.svg'), 'Zoom', self.zoom)
+ a.setToolTip('Zoom to rectangle')
+ self.addSeparator()
+ a = self.addAction(self._icon('subplots.png'), 'Subplots',
+ self.configure_subplots)
+ a.setToolTip('Configure subplots')
+ a = self.addAction(self._icon('filesave.svg'), 'Save',
+ self.save_figure)
+ a.setToolTip('Save the figure')
- button = QtGui.QPushButton( QtGui.QIcon( image ), "", self )
- button.setToolTip(tooltip_text)
- self.buttons[ text ] = button
+ self.buttons = {}
- # The automatic layout doesn't look that good - it's too close
- # to the images so add a margin around it.
- margin = self.margin
- button.setFixedSize( image.width()+margin, image.height()+margin )
-
- QtCore.QObject.connect( button, QtCore.SIGNAL( 'clicked()' ),
- getattr( self, callback ) )
- self.layout.addWidget( button )
-
# Add the x,y location widget at the right side of the toolbar
# The stretch factor is 1 which means any resizing of the toolbar
# will resize this label instead of the buttons.
- self.locLabel = QtGui.QLabel( "", self )
- self.locLabel.setAlignment( QtCore.Qt.AlignRight | QtCore.Qt.AlignTop )
- self.locLabel.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Ignored,
- QtGui.QSizePolicy.Ignored))
- self.layout.addWidget( self.locLabel, 1 )
+ if self.coordinates:
+ self.locLabel = QtGui.QLabel( "", self )
+ self.locLabel.setAlignment(
+ QtCore.Qt.AlignRight | QtCore.Qt.AlignTop )
+ self.locLabel.setSizePolicy(
+ QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
+ QtGui.QSizePolicy.Ignored))
+ labelAction = self.addWidget(self.locLabel)
+ labelAction.setVisible(True)
# reference holder for subplots_adjust window
self.adj_window = None
@@ -351,7 +315,9 @@
self.canvas.draw()
def set_message( self, s ):
- self.locLabel.setText( s.replace(', ', '\n') )
+ self.emit(QtCore.SIGNAL("message"), s)
+ if self.coordinates:
+ self.locLabel.setText(s.replace(', ', '\n'))
def set_cursor( self, cursor ):
if DEBUG: print 'Set cursor' , cursor
@@ -384,28 +350,6 @@
win.show()
-# self.adj_window = QtGui.QDialog()
-# win = self.adj_window
-# win.setAttribute(QtCore.Qt.WA_DeleteOnClose)
-# win.setWindowTitle("Subplot Configuration Tool")
-# image = os.path.join( matplotlib.rcParams['datapath'],'images','matplotlib.png' )
-# win.setWindowIcon(QtGui.QIcon( image ))
-#
-# toolfig = Figure(figsize=(6,3))
-# toolfig.subplots_adjust(top=0.9)
-# canvas = self._get_canvas(toolfig)
-# tool = SubplotTool(self.canvas.figure, toolfig)
-#
-# canvas.setParent(win)
-# w = int (toolfig.bbox.width())
-# h = int (toolfig.bbox.height())
-#
-# win.resize(w, h)
-# canvas.setFocus()
-#
-# canvas.show()
-# win.show()
-
def _get_canvas(self, fig):
return FigureCanvasQT(fig)
@@ -425,7 +369,7 @@
selectedFilter = filter
filters.append(filter)
filters = ';;'.join(filters)
-
+
fname = QtGui.QFileDialog.getSaveFileName(
self, "Choose a filename to save to", start, filters, selectedFilter)
if fname:
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-01-26 13:22:33 UTC (rev 4900)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-01-27 15:17:28 UTC (rev 4901)
@@ -35,7 +35,7 @@
# must be inited after the window, drawingArea and figure
# attrs are set
if matplotlib.rcParams['toolbar']=='classic':
- print "Classic toolbar is not yet supported"
+ print "Classic toolbar is not supported"
elif matplotlib.rcParams['toolbar']=='toolbar2':
toolbar = NavigationToolbar2QTAgg(canvas, parent)
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-01-31 15:28:39
|
Revision: 4912
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4912&view=rev
Author: mdboom
Date: 2008-01-31 07:28:29 -0800 (Thu, 31 Jan 2008)
Log Message:
-----------
Merged revisions 4867-4911 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4874 | jdh2358 | 2008-01-16 23:13:27 -0500 (Wed, 16 Jan 2008) | 1 line
forced nonunicode fname for save in agg
........
r4879 | mdboom | 2008-01-18 12:59:51 -0500 (Fri, 18 Jan 2008) | 2 lines
Fix poly_editor.py
........
r4882 | mdboom | 2008-01-21 14:03:48 -0500 (Mon, 21 Jan 2008) | 2 lines
Fix bug with pie chart slices less than 2.5 degrees.
........
r4896 | efiring | 2008-01-25 19:11:36 -0500 (Fri, 25 Jan 2008) | 2 lines
Apply patch by Manuel Metz to scatter docstring.
........
r4904 | jrevans | 2008-01-28 13:02:31 -0500 (Mon, 28 Jan 2008) | 4 lines
Fixed a bug where plotting a singe point unitized errorbar data would
fail. Fixed a bug where plotting errorbar data where the error is a
duration for a time valued axes would fail.
........
r4907 | mdboom | 2008-01-29 15:24:58 -0500 (Tue, 29 Jan 2008) | 1 line
Allow updating of shared axes when calling Axes.axis() (Thanks Jorgen Stenarson)
........
r4911 | mdboom | 2008-01-31 10:21:10 -0500 (Thu, 31 Jan 2008) | 2 lines
Fix \sqrt with a numeric radical.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/mathtext_examples.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/mathtext.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4866
+ /branches/v0_91_maint:1-4911
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-01-31 15:21:10 UTC (rev 4911)
+++ trunk/matplotlib/CHANGELOG 2008-01-31 15:28:29 UTC (rev 4912)
@@ -1,3 +1,6 @@
+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
Modified: trunk/matplotlib/examples/mathtext_examples.py
===================================================================
--- trunk/matplotlib/examples/mathtext_examples.py 2008-01-31 15:21:10 UTC (rev 4911)
+++ trunk/matplotlib/examples/mathtext_examples.py 2008-01-31 15:28:29 UTC (rev 4912)
@@ -40,7 +40,7 @@
r"$f^'$",
r'$\frac{x_2888}{y}$',
r"$\sqrt[3]{\frac{X_2}{Y}}=5$",
- r"$\sqrt[5x\pi]{\prod^\frac{x}{2\pi^2}_\infty}$",
+ r"$\sqrt[5]{\prod^\frac{x}{2\pi^2}_\infty}$",
r"$\sqrt[3]{x}=5$",
r'$\frac{X}{\frac{X}{Y}}$',
# From UTR #25
@@ -56,7 +56,7 @@
def doall():
tests = stests
-
+
figure(figsize=(8, (len(tests) * 1) + 2))
plot([0, 0], 'r')
grid(False)
@@ -69,7 +69,7 @@
savefig('mathtext_examples')
#close('all')
show()
-
+
if '--latex' in sys.argv:
fd = open("mathtext_examples.ltx", "w")
fd.write("\\documentclass{article}\n")
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-01-31 15:21:10 UTC (rev 4911)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-01-31 15:28:29 UTC (rev 4912)
@@ -2641,10 +2641,6 @@
ymin = npy.asarray(ymin)
ymax = npy.asarray(ymax)
- if len(ymin)==1:
- ymin = ymin*npy.ones(x.shape, x.dtype)
- if len(ymax)==1:
- ymax = ymax*npy.ones(x.shape, x.dtype)
if len(ymin)!=len(x):
raise ValueError, 'ymin and x are unequal sized sequences'
@@ -2661,12 +2657,17 @@
self.add_collection(coll)
coll.update(kwargs)
- minx = x.min()
- maxx = x.max()
- miny = min(ymin.min(), ymax.min())
- maxy = max(ymin.max(), ymax.max())
- minx, maxx = self.convert_xunits((minx, maxx))
- miny, maxy = self.convert_yunits((miny, maxy))
+ # We do the conversion first since not all unitized data is uniform
+ xx = self.convert_xunits( x )
+ yymin = self.convert_yunits( ymin )
+ yymax = self.convert_yunits( ymax )
+
+ minx = min( xx )
+ maxx = max( xx )
+
+ miny = min( min(yymin), min(yymax) )
+ maxy = max( max(yymin), max(yymax) )
+
corners = (minx, miny), (maxx, maxy)
self.update_datalim(corners)
self.autoscale_view()
@@ -4165,6 +4166,18 @@
Finally, marker can be (verts, 0), verts is a sequence of (x,y)
vertices for a custom scatter symbol.
+ numsides is the number of sides
+
+ style is the style of the regular symbol:
+ 0 : a regular polygon
+ 1 : a star-like symbol
+ 2 : an asterisk
+
+ angle is the angle of rotation of the symbol
+
+ Finally, marker can be (verts, 0), verts is a sequence of (x,y)
+ vertices for a custom scatter symbol.
+
s is a size argument in points squared.
Any or all of x, y, s, and c may be masked arrays, in which
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-01-31 15:21:10 UTC (rev 4911)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-01-31 15:28:29 UTC (rev 4912)
@@ -2102,12 +2102,7 @@
Suppress(Literal(r"\sqrt"))
+ Optional(
Suppress(Literal("["))
- + Group(
- OneOrMore(
- (c_over_c | symbol)
- ^ font
- )
- )
+ + Regex("[0-9]+")
+ Suppress(Literal("]")),
default = None
)
@@ -2595,11 +2590,7 @@
if root is None:
root = Box(0., 0., 0.)
else:
- if not isinstance(root, ParseResults):
- raise ParseFatalException(
- "Can not parse root of radical. "
- "Only simple symbols are allowed in the root.")
- root = Hlist(root.asList())
+ root = Hlist([Char(x, state) for x in root])
root.shrink()
root.shrink()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-01-31 19:01:43
|
Revision: 4915
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4915&view=rev
Author: mdboom
Date: 2008-01-31 11:01:38 -0800 (Thu, 31 Jan 2008)
Log Message:
-----------
Merged revisions 4912-4914 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4914 | mdboom | 2008-01-31 13:59:22 -0500 (Thu, 31 Jan 2008) | 2 lines
Fix text spacing problems in PDF backend with some fonts.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4911
+ /branches/v0_91_maint:1-4914
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-01-31 18:59:22 UTC (rev 4914)
+++ trunk/matplotlib/CHANGELOG 2008-01-31 19:01:38 UTC (rev 4915)
@@ -1,3 +1,6 @@
+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
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-01-31 18:59:22 UTC (rev 4914)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-01-31 19:01:38 UTC (rev 4915)
@@ -801,8 +801,7 @@
ccode = ord(c)
gind = cmap.get(ccode) or 0
glyph = font.load_char(ccode, flags=LOAD_NO_HINTING)
- # Why divided by 3.0 ??? Wish I knew... MGD
- widths.append((ccode, cvt(glyph.horiAdvance) / 3.0))
+ widths.append((ccode, glyph.horiAdvance / 6))
if ccode < 65536:
cid_to_gid_map[ccode] = unichr(gind)
max_ccode = max(ccode, max_ccode)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-01 17:23:45
|
Revision: 4919
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4919&view=rev
Author: mdboom
Date: 2008-02-01 09:23:41 -0800 (Fri, 01 Feb 2008)
Log Message:
-----------
Merged revisions 4915-4918 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4916 | dsdale | 2008-01-31 14:05:28 -0500 (Thu, 31 Jan 2008) | 2 lines
fixed a bug in ticker, unicode string passed to tex
........
r4917 | dsdale | 2008-01-31 14:14:20 -0500 (Thu, 31 Jan 2008) | 2 lines
forgot to change unicode string to raw string
........
r4918 | mdboom | 2008-02-01 12:19:02 -0500 (Fri, 01 Feb 2008) | 2 lines
Fix reference leak on Glyph objects.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/src/ft2font.cpp
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4914
+ /branches/v0_91_maint:1-4918
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-01 17:19:02 UTC (rev 4918)
+++ trunk/matplotlib/CHANGELOG 2008-02-01 17:23:41 UTC (rev 4919)
@@ -1,3 +1,7 @@
+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.
Modified: trunk/matplotlib/src/ft2font.cpp
===================================================================
--- trunk/matplotlib/src/ft2font.cpp 2008-02-01 17:19:02 UTC (rev 4918)
+++ trunk/matplotlib/src/ft2font.cpp 2008-02-01 17:23:41 UTC (rev 4919)
@@ -8,9 +8,9 @@
/**
To improve the hinting of the fonts, this code uses a hack
presented here:
-
+
http://antigrain.com/research/font_rasterization/index.html
-
+
The idea is to limit the effect of hinting in the x-direction, while
preserving hinting in the y-direction. Since freetype does not
support this directly, the dpi in the x-direction is set higher than
@@ -20,7 +20,7 @@
hinting, whereas the global transform does not, this is documented
behavior of freetype, and therefore hopefully unlikely to change.
The freetype 2 tutorial says:
-
+
NOTE: The transformation is applied to every glyph that is
loaded through FT_Load_Glyph and is completely independent of
any hinting process. This means that you won't get the same
@@ -42,7 +42,7 @@
FT_Library _ft2Library;
-// FT2Image::FT2Image() :
+// FT2Image::FT2Image() :
// _isDirty(true),
// _buffer(NULL),
// _width(0), _height(0),
@@ -53,7 +53,7 @@
FT2Image::FT2Image(unsigned long width, unsigned long height) :
_isDirty(true),
- _buffer(NULL),
+ _buffer(NULL),
_width(0), _height(0),
_rgbCopy(NULL),
_rgbaCopy(NULL) {
@@ -61,10 +61,10 @@
resize(width, height);
}
-FT2Image::~FT2Image() {
+FT2Image::~FT2Image() {
_VERBOSE("FT2Image::~FT2Image");
- delete [] _buffer;
- _buffer=NULL;
+ delete [] _buffer;
+ _buffer=NULL;
delete _rgbCopy;
delete _rgbaCopy;
}
@@ -151,7 +151,7 @@
}
void
-FT2Image::draw_rect(unsigned long x0, unsigned long y0,
+FT2Image::draw_rect(unsigned long x0, unsigned long y0,
unsigned long x1, unsigned long y1) {
if ( x0<0 || y0<0 || x1<0 || y1<0 ||
x0>_width || x1>_width ||
@@ -195,7 +195,7 @@
return Py::Object();
}
-void FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0,
+void FT2Image::draw_rect_filled(unsigned long x0, unsigned long y0,
unsigned long x1, unsigned long y1) {
x0 = CLAMP(x0, 0, _width);
y0 = CLAMP(y0, 0, _height);
@@ -209,7 +209,7 @@
}
_isDirty = true;
-}
+}
char FT2Image::draw_rect_filled__doc__[] =
"draw_rect_filled(x0, y0, x1, y1)\n"
@@ -245,7 +245,7 @@
args.verify_length(0);
return Py::asObject
- (PyString_FromStringAndSize((const char *)_buffer,
+ (PyString_FromStringAndSize((const char *)_buffer,
_width*_height)
);
}
@@ -284,7 +284,7 @@
args.verify_length(0);
makeRgbCopy();
-
+
return _rgbCopy->py_as_str(args);
}
@@ -321,7 +321,7 @@
args.verify_length(0);
makeRgbaCopy();
-
+
return _rgbaCopy->py_as_str(args);
}
@@ -671,7 +671,7 @@
}
// set a default fontsize 12 pt at 72dpi
-#ifdef VERTICAL_HINTING
+#ifdef VERTICAL_HINTING
error = FT_Set_Char_Size( face, 12 * 64, 0, 72 * HORIZ_HINTING, 72 );
static FT_Matrix transform = { 65536 / HORIZ_HINTING, 0, 0, 65536 };
FT_Set_Transform( face, &transform, 0 );
@@ -829,7 +829,7 @@
int error = FT_Set_Char_Size( face, (long)(ptsize * 64), 0,
(unsigned int)dpi,
(unsigned int)dpi );
-#endif
+#endif
if (error)
throw Py::RuntimeError("Could not set the fontsize");
return Py::Object();
@@ -1036,7 +1036,6 @@
if ( (size_t)num >= gms.size())
throw Py::ValueError("Glyph index out of range");
- Py_INCREF(gms[num]);
return Py::asObject(gms[num]);
}
@@ -1078,7 +1077,7 @@
long charcode = Py::Long(args[0]), flags = Py::Long(FT_LOAD_FORCE_AUTOHINT);
if (kwargs.hasKey("flags"))
flags = Py::Long(kwargs["flags"]);
-
+
int error = FT_Load_Char( face, (unsigned long)charcode, flags);
if (error)
@@ -1094,7 +1093,6 @@
glyphs.push_back(thisGlyph);
Glyph* gm = new Glyph(face, thisGlyph, num);
gms.push_back(gm);
- Py_INCREF(gm); //todo: refcount correct?
return Py::asObject( gm);
}
@@ -1659,7 +1657,7 @@
}
}
-char FT2Font::get_image__doc__ [] =
+char FT2Font::get_image__doc__ [] =
"get_image()\n"
"\n"
"Returns the underlying image buffer for this font object.\n";
@@ -1669,7 +1667,7 @@
if (image) {
Py_XINCREF(image);
return Py::asObject(image);
- }
+ }
throw Py::RuntimeError("You must call .set_text() before .get_image()");
}
@@ -1684,7 +1682,7 @@
args.verify_length(1);
std::string filename = Py::String(args[0]);
- FT_Error error =
+ FT_Error error =
FT_Attach_File(face, filename.c_str());
if (error) {
@@ -1884,7 +1882,7 @@
d["KERNING_DEFAULT"] = Py::Int(FT_KERNING_DEFAULT);
d["KERNING_UNFITTED"] = Py::Int(FT_KERNING_UNFITTED);
d["KERNING_UNSCALED"] = Py::Int(FT_KERNING_UNSCALED);
-
+
d["LOAD_DEFAULT"] = Py::Long(FT_LOAD_DEFAULT);
d["LOAD_NO_SCALE"] = Py::Long(FT_LOAD_NO_SCALE);
d["LOAD_NO_HINTING"] = Py::Long(FT_LOAD_NO_HINTING);
@@ -1894,7 +1892,7 @@
d["LOAD_FORCE_AUTOHINT"] = Py::Long(FT_LOAD_FORCE_AUTOHINT);
d["LOAD_CROP_BITMAP"] = Py::Long(FT_LOAD_CROP_BITMAP);
d["LOAD_PEDANTIC"] = Py::Long(FT_LOAD_PEDANTIC);
- d["LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH"] =
+ d["LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH"] =
Py::Long(FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
d["LOAD_NO_RECURSE"] = Py::Long(FT_LOAD_NO_RECURSE);
d["LOAD_IGNORE_TRANSFORM"] = Py::Long(FT_LOAD_IGNORE_TRANSFORM);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-01 18:40:03
|
Revision: 4926
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4926&view=rev
Author: mdboom
Date: 2008-02-01 10:39:59 -0800 (Fri, 01 Feb 2008)
Log Message:
-----------
Merged revisions 4921-4925 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4922 | mdboom | 2008-02-01 13:02:14 -0500 (Fri, 01 Feb 2008) | 3 lines
Backing out Glyph object leak fix, since it causes segfaults with PDF
backend. Will look into it further.
........
r4924 | mdboom | 2008-02-01 13:03:52 -0500 (Fri, 01 Feb 2008) | 2 lines
Oops in last commit.
........
r4925 | mdboom | 2008-02-01 13:36:38 -0500 (Fri, 01 Feb 2008) | 2 lines
Hopefully fixing the Glyph memory leak properly now.
........
Modified Paths:
--------------
trunk/matplotlib/src/ft2font.cpp
trunk/matplotlib/src/ft2font.h
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4920
+ /branches/v0_91_maint:1-4925
Modified: trunk/matplotlib/src/ft2font.cpp
===================================================================
--- trunk/matplotlib/src/ft2font.cpp 2008-02-01 18:36:38 UTC (rev 4925)
+++ trunk/matplotlib/src/ft2font.cpp 2008-02-01 18:39:59 UTC (rev 4926)
@@ -749,10 +749,6 @@
for (size_t i=0; i<glyphs.size(); i++) {
FT_Done_Glyph( glyphs[i] );
}
-
- for (size_t i=0; i<gms.size(); i++) {
- Py_DECREF(gms[i]);
- }
}
int
@@ -792,13 +788,8 @@
FT_Done_Glyph( glyphs[i] );
}
- for (size_t i=0; i<gms.size(); i++) {
- Py_DECREF(gms[i]);
- }
+ glyphs.clear();
- glyphs.resize(0);
- gms.resize(0);
-
return Py::Object();
}
@@ -1020,26 +1011,6 @@
return xys;
}
-
-char FT2Font::get_glyph__doc__[] =
-"get_glyph(num)\n"
-"\n"
-"Return the glyph object with num num\n"
-;
-Py::Object
-FT2Font::get_glyph(const Py::Tuple & args){
- _VERBOSE("FT2Font::get_glyph");
-
- args.verify_length(1);
- int num = Py::Int(args[0]);
-
- if ( (size_t)num >= gms.size())
- throw Py::ValueError("Glyph index out of range");
-
- Py_INCREF(gms[num]);
- return Py::asObject(gms[num]);
-}
-
char FT2Font::get_num_glyphs__doc__[] =
"get_num_glyphs()\n"
"\n"
@@ -1093,9 +1064,7 @@
size_t num = glyphs.size(); //the index into the glyphs list
glyphs.push_back(thisGlyph);
Glyph* gm = new Glyph(face, thisGlyph, num);
- gms.push_back(gm);
- Py_INCREF(gm);
- return Py::asObject( gm);
+ return Py::asObject(gm);
}
char FT2Font::get_width_height__doc__[] =
@@ -1763,8 +1732,6 @@
add_varargs_method("get_xys", &FT2Font::get_xys,
FT2Font::get_xys__doc__);
- add_varargs_method("get_glyph", &FT2Font::get_glyph,
- FT2Font::get_glyph__doc__);
add_varargs_method("get_num_glyphs", &FT2Font::get_num_glyphs,
FT2Font::get_num_glyphs__doc__);
add_keyword_method("load_char", &FT2Font::load_char,
Modified: trunk/matplotlib/src/ft2font.h
===================================================================
--- trunk/matplotlib/src/ft2font.h 2008-02-01 18:36:38 UTC (rev 4925)
+++ trunk/matplotlib/src/ft2font.h 2008-02-01 18:39:59 UTC (rev 4926)
@@ -30,11 +30,11 @@
void draw_bitmap(FT_Bitmap* bitmap, FT_Int x, FT_Int y);
void write_bitmap(const char* filename) const;
- void draw_rect(unsigned long x0, unsigned long y0,
+ void draw_rect(unsigned long x0, unsigned long y0,
unsigned long x1, unsigned long y1);
- void draw_rect_filled(unsigned long x0, unsigned long y0,
+ void draw_rect_filled(unsigned long x0, unsigned long y0,
unsigned long x1, unsigned long y1);
-
+
unsigned int get_width() const { return _width; };
unsigned int get_height() const { return _height; };
const unsigned char *const get_buffer() const { return _buffer; };
@@ -94,7 +94,6 @@
Py::Object set_size(const Py::Tuple & args);
Py::Object set_charmap(const Py::Tuple & args);
Py::Object set_text(const Py::Tuple & args, const Py::Dict & kwargs);
- Py::Object get_glyph(const Py::Tuple & args);
Py::Object get_kerning(const Py::Tuple & args);
Py::Object get_num_glyphs(const Py::Tuple & args);
Py::Object load_char(const Py::Tuple & args, const Py::Dict & kws);
@@ -124,7 +123,6 @@
FT_Error error;
std::vector<FT_Glyph> glyphs;
std::vector<FT_Vector> pos;
- std::vector<Glyph*> gms;
double angle;
double ptsize;
double dpi;
@@ -168,16 +166,16 @@
Glyph::init_type();
FT2Font::init_type();
- add_varargs_method("FT2Font", &ft2font_module::new_ft2font,
+ add_varargs_method("FT2Font", &ft2font_module::new_ft2font,
"FT2Font");
- add_varargs_method("FT2Image", &ft2font_module::new_ft2image,
+ add_varargs_method("FT2Image", &ft2font_module::new_ft2image,
"FT2Image");
initialize( "The ft2font module" );
}
-
- ~ft2font_module();
+
+ ~ft2font_module();
//static FT_Library ft2Library;
-
+
private:
Py::Object new_ft2font (const Py::Tuple &args);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-01 19:15:24
|
Revision: 4928
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4928&view=rev
Author: mdboom
Date: 2008-02-01 11:15:20 -0800 (Fri, 01 Feb 2008)
Log Message:
-----------
Merged revisions 4926-4927 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4927 | mdboom | 2008-02-01 14:13:09 -0500 (Fri, 01 Feb 2008) | 2 lines
Fix doubly-included fonts in Postscript files.
........
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mathtext.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4925
+ /branches/v0_91_maint:1-4927
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-02-01 19:13:09 UTC (rev 4927)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-02-01 19:15:20 UTC (rev 4928)
@@ -552,7 +552,6 @@
A generic base class for all font setups that use Truetype fonts
(through ft2font)
"""
- basepath = os.path.join( get_data_path(), 'fonts' )
_fonts = {}
class CachedFont:
@@ -686,7 +685,7 @@
TruetypeFonts.__init__(self, *args, **kwargs)
if not len(self.fontmap):
for key, val in self._fontmap.iteritems():
- fullpath = os.path.join(self.basepath, 'ttf', val + ".ttf")
+ fullpath = findfont(val)
self.fontmap[key] = fullpath
self.fontmap[val] = fullpath
@@ -913,7 +912,7 @@
TruetypeFonts.__init__(self, *args, **kwargs)
if not len(self.fontmap):
for key, name in self._fontmap.iteritems():
- fullpath = os.path.join(self.basepath, 'ttf', name + ".ttf")
+ fullpath = findfont(name)
self.fontmap[key] = fullpath
self.fontmap[name] = fullpath
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-01 20:16:01
|
Revision: 4929
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4929&view=rev
Author: mdboom
Date: 2008-02-01 12:15:59 -0800 (Fri, 01 Feb 2008)
Log Message:
-----------
Fix tick-alignment problem (Thanks J?\195?\182rgen Stenarson)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/lines.py
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py 2008-02-01 19:15:20 UTC (rev 4928)
+++ trunk/matplotlib/lib/matplotlib/lines.py 2008-02-01 20:15:59 UTC (rev 4929)
@@ -875,7 +875,7 @@
path, path_trans)
- _tickhoriz_path = Path([[0.0, 0.5], [1.0, 0.5]])
+ _tickhoriz_path = Path([[0.0, 0.0], [1.0, 0.0]])
def _draw_tickleft(self, renderer, gc, path, path_trans):
offset = renderer.points_to_pixels(self._markersize)
marker_transform = Affine2D().scale(-offset, 1.0)
@@ -890,7 +890,7 @@
path, path_trans)
- _tickvert_path = Path([[-0.5, 0.0], [-0.5, 1.0]])
+ _tickvert_path = Path([[-0.0, 0.0], [-0.0, 1.0]])
def _draw_tickup(self, renderer, gc, path, path_trans):
offset = renderer.points_to_pixels(self._markersize)
marker_transform = Affine2D().scale(1.0, offset)
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2008-02-01 19:15:20 UTC (rev 4928)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-02-01 20:15:59 UTC (rev 4929)
@@ -465,7 +465,7 @@
RendererAgg::draw_markers(const Py::Tuple& args) {
typedef agg::conv_transform<PathIterator> transformed_path_t;
typedef SimplifyPath<transformed_path_t> simplify_t;
- typedef agg::conv_curve<transformed_path_t> curve_t;
+ typedef agg::conv_curve<simplify_t> curve_t;
typedef agg::conv_stroke<curve_t> stroke_t;
typedef agg::pixfmt_amask_adaptor<pixfmt, alpha_mask_type> pixfmt_amask_type;
typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type;
@@ -488,15 +488,15 @@
trans *= agg::trans_affine_translation(0.0, (double)height);
PathIterator marker_path(marker_path_obj);
+ bool marker_snap = should_snap(marker_path, marker_trans);
transformed_path_t marker_path_transformed(marker_path, marker_trans);
- curve_t marker_path_curve(marker_path_transformed);
+ simplify_t marker_path_simplified(marker_path_transformed, marker_snap, false, width, height);
+ curve_t marker_path_curve(marker_path_simplified);
PathIterator path(path_obj);
- bool snap = should_snap(path, trans);
transformed_path_t path_transformed(path, trans);
GCAgg gc = GCAgg(gc_obj, dpi);
- simplify_t path_simplified(path_transformed, snap, false, width, height);
- path_simplified.rewind(0);
+ path_transformed.rewind(0);
facepair_t face = _get_rgba_face(face_obj, gc.alpha);
@@ -549,7 +549,7 @@
agg::serialized_scanlines_adaptor_aa8::embedded_scanline sl;
if (has_clippath) {
- while (path_simplified.vertex(&x, &y) != agg::path_cmd_stop) {
+ while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
pixfmt_amask_type pfa(*pixFmt, *alphaMask);
amask_ren_type r(pfa);
amask_aa_renderer_type ren(r);
@@ -564,7 +564,7 @@
agg::render_scanlines(sa, sl, ren);
}
} else {
- while (path_simplified.vertex(&x, &y) != agg::path_cmd_stop) {
+ while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
if (face.first) {
rendererAA->color(face.second);
sa.init(fillCache, fillSize, x, y);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-02 07:53:07
|
Revision: 4930
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4930&view=rev
Author: efiring
Date: 2008-02-01 23:53:03 -0800 (Fri, 01 Feb 2008)
Log Message:
-----------
Added BoundaryNorm to support irregular discrete color intervals
Modified Paths:
--------------
trunk/matplotlib/examples/colorbar_only.py
trunk/matplotlib/lib/matplotlib/colorbar.py
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/examples/colorbar_only.py
===================================================================
--- trunk/matplotlib/examples/colorbar_only.py 2008-02-01 20:15:59 UTC (rev 4929)
+++ trunk/matplotlib/examples/colorbar_only.py 2008-02-02 07:53:03 UTC (rev 4930)
@@ -2,12 +2,12 @@
Make a colorbar as a separate figure.
'''
-import pylab
-import matplotlib as mpl
+from matplotlib import pyplot, mpl
# Make a figure and axes with dimensions as desired.
-fig = pylab.figure(figsize=(8,1.5))
-ax = fig.add_axes([0.05, 0.4, 0.9, 0.5])
+fig = pyplot.figure(figsize=(8,3))
+ax1 = fig.add_axes([0.05, 0.65, 0.9, 0.15])
+ax2 = fig.add_axes([0.05, 0.25, 0.9, 0.15])
# Set the colormap and norm to correspond to the data for which
# the colorbar will be used.
@@ -19,10 +19,33 @@
# standalone colorbar. There are many more kwargs, but the
# following gives a basic continuous colorbar with ticks
# and labels.
-cb = mpl.colorbar.ColorbarBase(ax, cmap=cmap,
+cb1 = mpl.colorbar.ColorbarBase(ax1, cmap=cmap,
norm=norm,
orientation='horizontal')
-cb.set_label('Some Units')
+cb1.set_label('Some Units')
-pylab.show()
+# The second example illustrates the use of a ListedColormap, a
+# BoundaryNorm, and extended ends to show the "over" and "under"
+# value colors.
+cmap = mpl.colors.ListedColormap(['r', 'g', 'b', 'c'])
+cmap.set_over('0.25')
+cmap.set_under('0.75')
+# If a ListedColormap is used, the length of the bounds array must be
+# one greater than the length of the color list. The bounds must be
+# monotonically increasing.
+bounds = [1, 2, 4, 7, 8]
+norm = mpl.colors.BoundaryNorm(bounds)
+cb2 = mpl.colorbar.ColorbarBase(ax2, cmap=cmap,
+ norm=norm,
+ # to use 'extend', you must
+ # specify two extra boundaries:
+ boundaries=[0]+bounds+[13],
+ extend='both',
+ ticks=bounds, # optional
+ spacing='proportional',
+ orientation='horizontal')
+cb2.set_label('Discrete intervals, some other units')
+
+pyplot.show()
+
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-02-01 20:15:59 UTC (rev 4929)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-02-02 07:53:03 UTC (rev 4930)
@@ -356,7 +356,7 @@
if b is None:
b = self.boundaries
if b is not None:
- self._boundaries = npy.array(b)
+ self._boundaries = npy.asarray(b, dtype=float)
if self.values is None:
self._values = 0.5*(self._boundaries[:-1]
+ self._boundaries[1:])
@@ -456,7 +456,12 @@
Return colorbar data coordinates for the boundaries of
a proportional colorbar.
'''
- y = self.norm(self._boundaries.copy())
+ if isinstance(self.norm, colors.BoundaryNorm):
+ b = self._boundaries[self._inside]
+ y = (self._boundaries - self._boundaries[0])
+ y = y / (self._boundaries[-1] - self._boundaries[0])
+ else:
+ y = self.norm(self._boundaries.copy())
if self.extend in ('both', 'min'):
y[0] = -0.05
if self.extend in ('both', 'max'):
@@ -492,7 +497,7 @@
within range, together with their corresponding colorbar
data coordinates.
'''
- if isinstance(self.norm, colors.NoNorm):
+ if isinstance(self.norm, (colors.NoNorm, colors.BoundaryNorm)):
b = self._boundaries
xn = x
xout = x
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-02-01 20:15:59 UTC (rev 4929)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-02-02 07:53:03 UTC (rev 4930)
@@ -684,7 +684,37 @@
else:
return vmin * pow((vmax/vmin), value)
+class BoundaryNorm(Normalize):
+ def __init__(self, boundaries, clip=False):
+ self.clip = clip
+ self.vmin = boundaries[0]
+ self.vmax = boundaries[-1]
+ self.boundaries = npy.asarray(boundaries)
+ self.midpoints = 0.5 *(self.boundaries[:-1] + self.boundaries[1:])
+ self.N = len(self.boundaries)
+ def __call__(self, x, clip=None):
+ if clip is None:
+ clip = self.clip
+ x = ma.asarray(x)
+ mask = ma.getmaskarray(x)
+ xx = x.filled(self.vmax+1)
+ if clip:
+ npy.clip(xx, self.vmin, self.vmax)
+ iret = npy.zeros(x.shape, dtype=npy.int16)
+ for i, b in enumerate(self.boundaries):
+ iret[xx>=b] = i
+ iret[xx<self.vmin] = -1
+ iret[xx>=self.vmax] = self.N
+ ret = ma.array(iret / float(self.N-1), mask=mask)
+ if ret.shape == () and not mask:
+ ret = float(ret) # assume python scalar
+ return ret
+
+ def inverse(self, value):
+ return self.midpoints[int(value*(self.N-1))]
+
+
class NoNorm(Normalize):
'''
Dummy replacement for Normalize, for the case where we
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2008-02-03 21:10:25
|
Revision: 4933
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4933&view=rev
Author: jouni
Date: 2008-02-03 13:10:22 -0800 (Sun, 03 Feb 2008)
Log Message:
-----------
Force the pdf backend to always use 72 as the dpi value. This fixes
the size problem of the resulting files (since the size is measured in
units of 1/72 inch). TODO: the user now has no control over the dpi
of images.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-02 21:32:21 UTC (rev 4932)
+++ trunk/matplotlib/CHANGELOG 2008-02-03 21:10:22 UTC (rev 4933)
@@ -1,3 +1,5 @@
+2008-02-03 Force dpi=72 in pdf backend to fix picture size bug. - JKS
+
2008-02-01 Fix reference leak in ft2font Glyph objects. - MGD
2008-01-31 Don't use unicode strings with usetex by default - DSD
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-02-02 21:32:21 UTC (rev 4932)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-02-03 21:10:22 UTC (rev 4933)
@@ -1853,8 +1853,9 @@
return 'pdf'
def print_pdf(self, filename, **kwargs):
- dpi = kwargs.get('dpi', 72)
- self.figure.set_dpi(dpi) # Override the dpi kwarg
+ dpi = 72 # there are 72 Postscript points to an inch
+ # TODO: use the dpi kwarg for images
+ self.figure.set_dpi(dpi)
width, height = self.figure.get_size_inches()
file = PdfFile(width, height, dpi, filename)
renderer = MixedModeRenderer(
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-03 21:27:04
|
Revision: 4934
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4934&view=rev
Author: efiring
Date: 2008-02-03 13:26:42 -0800 (Sun, 03 Feb 2008)
Log Message:
-----------
Modified BoundaryNorm, examples, colorbar support
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/colorbar_only.py
trunk/matplotlib/examples/image_masked.py
trunk/matplotlib/lib/matplotlib/colorbar.py
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-03 21:10:22 UTC (rev 4933)
+++ trunk/matplotlib/CHANGELOG 2008-02-03 21:26:42 UTC (rev 4934)
@@ -1,3 +1,6 @@
+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 reference leak in ft2font Glyph objects. - MGD
Modified: trunk/matplotlib/examples/colorbar_only.py
===================================================================
--- trunk/matplotlib/examples/colorbar_only.py 2008-02-03 21:10:22 UTC (rev 4933)
+++ trunk/matplotlib/examples/colorbar_only.py 2008-02-03 21:26:42 UTC (rev 4934)
@@ -35,7 +35,7 @@
# one greater than the length of the color list. The bounds must be
# monotonically increasing.
bounds = [1, 2, 4, 7, 8]
-norm = mpl.colors.BoundaryNorm(bounds)
+norm = mpl.colors.BoundaryNorm(bounds, cmap.N)
cb2 = mpl.colorbar.ColorbarBase(ax2, cmap=cmap,
norm=norm,
# to use 'extend', you must
Modified: trunk/matplotlib/examples/image_masked.py
===================================================================
--- trunk/matplotlib/examples/image_masked.py 2008-02-03 21:10:22 UTC (rev 4933)
+++ trunk/matplotlib/examples/image_masked.py 2008-02-03 21:26:42 UTC (rev 4934)
@@ -1,6 +1,8 @@
#!/usr/bin/env python
'''imshow with masked array input and out-of-range colors.
+ The second subplot illustrates the use of BoundaryNorm to
+ get a filled contour effect.
'''
from pylab import *
@@ -31,10 +33,23 @@
# range to which the regular palette color scale is applied.
# Anything above that range is colored based on palette.set_over, etc.
+subplot(1,2,1)
im = imshow(Zm, interpolation='bilinear',
cmap=palette,
norm = colors.Normalize(vmin = -1.0, vmax = 1.0, clip = False),
origin='lower', extent=[-3,3,-3,3])
title('Green=low, Red=high, Blue=bad')
-colorbar(im, extend='both', shrink=0.8)
+colorbar(im, extend='both', orientation='horizontal', shrink=0.8)
+
+subplot(1,2,2)
+im = imshow(Zm, interpolation='nearest',
+ cmap=palette,
+ norm = colors.BoundaryNorm([-1, -0.5, -0.2, 0, 0.2, 0.5, 1],
+ ncolors=256, clip = False),
+ origin='lower', extent=[-3,3,-3,3])
+title('With BoundaryNorm')
+colorbar(im, extend='both', spacing='proportional',
+ orientation='horizontal', shrink=0.8)
+
show()
+
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-02-03 21:10:22 UTC (rev 4933)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-02-03 21:26:42 UTC (rev 4934)
@@ -323,6 +323,9 @@
nv = len(self._values)
base = 1 + int(nv/10)
locator = ticker.IndexLocator(base=base, offset=0)
+ elif isinstance(self.norm, colors.BoundaryNorm):
+ b = self.norm.boundaries
+ locator = ticker.FixedLocator(b, nbins=10)
elif isinstance(self.norm, colors.LogNorm):
locator = ticker.LogLocator()
else:
@@ -389,6 +392,23 @@
self._boundaries = b
self._values = v
return
+ elif isinstance(self.norm, colors.BoundaryNorm):
+ b = list(self.norm.boundaries)
+ if self.extend in ('both', 'min'):
+ b = [b[0]-1] + b
+ if self.extend in ('both', 'max'):
+ b = b + [b[-1] + 1]
+ b = npy.array(b)
+ v = npy.zeros((len(b)-1,), dtype=float)
+ bi = self.norm.boundaries
+ v[self._inside] = 0.5*(bi[:-1] + bi[1:])
+ if self.extend in ('both', 'min'):
+ v[0] = b[0] - 1
+ if self.extend in ('both', 'max'):
+ v[-1] = b[-1] + 1
+ self._boundaries = b
+ self._values = v
+ return
else:
if not self.norm.scaled():
self.norm.vmin = 0
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-02-03 21:10:22 UTC (rev 4933)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-02-03 21:26:42 UTC (rev 4934)
@@ -685,13 +685,41 @@
return vmin * pow((vmax/vmin), value)
class BoundaryNorm(Normalize):
- def __init__(self, boundaries, clip=False):
+ '''
+ Generate a colormap index based on discrete intervals.
+
+ Unlike Normalize or LogNorm, BoundaryNorm maps values
+ to integers instead of to the interval 0-1.
+
+ Mapping to the 0-1 interval could have been done via
+ piece-wise linear interpolation, but using integers seems
+ simpler, and reduces the number of conversions back and forth
+ between integer and floating point.
+ '''
+ def __init__(self, boundaries, ncolors, clip=False):
+ '''
+ args:
+ boundaries: a monotonically increasing sequence
+ ncolors: number of colors in the colormap to be used
+
+ If b[i] <= v < b[i+1] then v is mapped to color j;
+ as i varies from 0 to len(boundaries)-2,
+ j goes from 0 to ncolors-1.
+
+ Out-of-range values are mapped to -1 if low and ncolors
+ if high; these are converted to valid indices by
+ Colormap.__call__.
+ '''
self.clip = clip
self.vmin = boundaries[0]
self.vmax = boundaries[-1]
self.boundaries = npy.asarray(boundaries)
- self.midpoints = 0.5 *(self.boundaries[:-1] + self.boundaries[1:])
self.N = len(self.boundaries)
+ self.Ncmap = ncolors
+ if self.N-1 == self.Ncmap:
+ self._interp = False
+ else:
+ self._interp = True
def __call__(self, x, clip=None):
if clip is None:
@@ -704,15 +732,17 @@
iret = npy.zeros(x.shape, dtype=npy.int16)
for i, b in enumerate(self.boundaries):
iret[xx>=b] = i
+ if self._interp:
+ iret = (iret * (float(self.Ncmap-1)/(self.N-2))).astype(npy.int16)
iret[xx<self.vmin] = -1
- iret[xx>=self.vmax] = self.N
- ret = ma.array(iret / float(self.N-1), mask=mask)
+ iret[xx>=self.vmax] = self.Ncmap
+ ret = ma.array(iret, mask=mask)
if ret.shape == () and not mask:
- ret = float(ret) # assume python scalar
+ ret = int(ret) # assume python scalar
return ret
def inverse(self, value):
- return self.midpoints[int(value*(self.N-1))]
+ return ValueError("BoundaryNorm is not invertible")
class NoNorm(Normalize):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-04 06:50:03
|
Revision: 4936
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4936&view=rev
Author: efiring
Date: 2008-02-03 22:50:00 -0800 (Sun, 03 Feb 2008)
Log Message:
-----------
Add AxesImage.interpnames (based on old request by fr...@gm...)
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/image.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-03 21:38:20 UTC (rev 4935)
+++ trunk/matplotlib/CHANGELOG 2008-02-04 06:50:00 UTC (rev 4936)
@@ -1,3 +1,6 @@
+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
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2008-02-03 21:38:20 UTC (rev 4935)
+++ trunk/matplotlib/lib/matplotlib/image.py 2008-02-04 06:50:00 UTC (rev 4936)
@@ -24,7 +24,32 @@
class AxesImage(martist.Artist, cm.ScalarMappable):
zorder = 1
+ # map interpolation strings to module constants
+ _interpd = {
+ 'nearest' : _image.NEAREST,
+ 'bilinear' : _image.BILINEAR,
+ 'bicubic' : _image.BICUBIC,
+ 'spline16' : _image.SPLINE16,
+ 'spline36' : _image.SPLINE36,
+ 'hanning' : _image.HANNING,
+ 'hamming' : _image.HAMMING,
+ 'hermite' : _image.HERMITE,
+ 'kaiser' : _image.KAISER,
+ 'quadric' : _image.QUADRIC,
+ 'catrom' : _image.CATROM,
+ 'gaussian' : _image.GAUSSIAN,
+ 'bessel' : _image.BESSEL,
+ 'mitchell' : _image.MITCHELL,
+ 'sinc' : _image.SINC,
+ 'lanczos' : _image.LANCZOS,
+ 'blackman' : _image.BLACKMAN,
+ }
+ # reverse interp dict
+ _interpdr = dict([ (v,k) for k,v in _interpd.items()])
+
+ interpnames = _interpd.keys()
+
def __init__(self, ax,
cmap = None,
norm = None,
@@ -59,30 +84,7 @@
self.set_filterrad(filterrad)
- # map interpolation strings to module constants
- self._interpd = {
- 'nearest' : _image.NEAREST,
- 'bilinear' : _image.BILINEAR,
- 'bicubic' : _image.BICUBIC,
- 'spline16' : _image.SPLINE16,
- 'spline36' : _image.SPLINE36,
- 'hanning' : _image.HANNING,
- 'hamming' : _image.HAMMING,
- 'hermite' : _image.HERMITE,
- 'kaiser' : _image.KAISER,
- 'quadric' : _image.QUADRIC,
- 'catrom' : _image.CATROM,
- 'gaussian' : _image.GAUSSIAN,
- 'bessel' : _image.BESSEL,
- 'mitchell' : _image.MITCHELL,
- 'sinc' : _image.SINC,
- 'lanczos' : _image.LANCZOS,
- 'blackman' : _image.BLACKMAN,
- }
- # reverse interp dict
- self._interpdr = dict([ (v,k) for k,v in self._interpd.items()])
-
self.set_interpolation(interpolation)
self.axes = ax
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-02-05 21:52:14
|
Revision: 4942
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4942&view=rev
Author: jdh2358
Date: 2008-02-05 13:52:04 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
added ginput example
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Added Paths:
-----------
trunk/matplotlib/examples/ginput_demo.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-05 21:50:58 UTC (rev 4941)
+++ trunk/matplotlib/CHANGELOG 2008-02-05 21:52:04 UTC (rev 4942)
@@ -1,3 +1,6 @@
+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
Added: trunk/matplotlib/examples/ginput_demo.py
===================================================================
--- trunk/matplotlib/examples/ginput_demo.py (rev 0)
+++ trunk/matplotlib/examples/ginput_demo.py 2008-02-05 21:52:04 UTC (rev 4942)
@@ -0,0 +1,6 @@
+from pylab import arange, plot, sin, ginput, show
+t = arange(10)
+plot(t, sin(t))
+print "Please click"
+ginput(3, verbose=True)
+show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-02-06 06:30:45
|
Revision: 4945
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4945&view=rev
Author: efiring
Date: 2008-02-05 22:30:44 -0800 (Tue, 05 Feb 2008)
Log Message:
-----------
Added getters for title, xlabel, ylabel (Brandon Kieth)
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-05 23:31:32 UTC (rev 4944)
+++ trunk/matplotlib/CHANGELOG 2008-02-06 06:30:44 UTC (rev 4945)
@@ -1,3 +1,6 @@
+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
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-02-05 23:31:32 UTC (rev 4944)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-02-06 06:30:44 UTC (rev 4945)
@@ -2225,6 +2225,12 @@
#### Labelling
+ def get_title(self):
+ """
+ Get the title text string.
+ """
+ return self.title.get_text()
+
def set_title(self, label, fontdict=None, **kwargs):
"""
SET_TITLE(label, fontdict=None, **kwargs):
@@ -2250,6 +2256,13 @@
return self.title
set_title.__doc__ = cbook.dedent(set_title.__doc__) % martist.kwdocd
+ def get_xlabel(self):
+ """
+ Get the xlabel text string.
+ """
+ label = self.xaxis.get_label()
+ return label.get_text()
+
def set_xlabel(self, xlabel, fontdict=None, **kwargs):
"""
SET_XLABEL(xlabel, fontdict=None, **kwargs)
@@ -2269,6 +2282,13 @@
return label
set_xlabel.__doc__ = cbook.dedent(set_xlabel.__doc__) % martist.kwdocd
+ def get_ylabel(self):
+ """
+ Get the ylabel text string.
+ """
+ label = self.yaxis.get_label()
+ return label.get_text()
+
def set_ylabel(self, ylabel, fontdict=None, **kwargs):
"""
SET_YLABEL(ylabel, fontdict=None, **kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-02-06 14:03:35
|
Revision: 4947
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4947&view=rev
Author: mdboom
Date: 2008-02-06 06:03:15 -0800 (Wed, 06 Feb 2008)
Log Message:
-----------
Merged revisions 4928-4946 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r4946 | mdboom | 2008-02-06 09:02:11 -0500 (Wed, 06 Feb 2008) | 1 line
Updating changelog
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4927
+ /branches/v0_91_maint:1-4946
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-02-06 14:02:11 UTC (rev 4946)
+++ trunk/matplotlib/CHANGELOG 2008-02-06 14:03:15 UTC (rev 4947)
@@ -12,6 +12,8 @@
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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|