[matplotlib-devel] Patch for uninitialized vertices in Path.arc

2011-07-18 Thread Richard Hattersley
Hi,
 
Using matplotlib.path.Path.arc to create a wedge (e.g. via 
matplotlib.path.Path.wedge) creates a Path with three uninitialized vertex 
positions. (The first one and the last two.)
 
As you would expect - sometimes this leads to nasty drawing artifacts!
 
I've tried zeroing the entire array and a couple of ways to just zero the 
offending vertices, but they all have equal performance, so I've gone with 
zeroing the entire array. It has the simplest, cleanest code, and will be more 
robust to future changes.
 
Regards
Richard Hattersley
 
 
--- patch follows --- 
 
>From 6f5d9f71d1d56d80c0c1764268a6ddfc3f653f44 Mon Sep 17 00:00:00 2001
From: Richard Hattersley 
Date: Mon, 18 Jul 2011 14:20:16 +0100
Subject: [PATCH] Fix uninitialized vertices in Path.arc() for wedges.
---
 lib/matplotlib/path.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/matplotlib/path.py b/lib/matplotlib/path.py
index da37d7d..d5461b0 100644
--- a/lib/matplotlib/path.py
+++ b/lib/matplotlib/path.py
@@ -621,7 +621,7 @@ class Path(object):
 if is_wedge:
 length = n * 3 + 4
-vertices = np.empty((length, 2), np.float_)
+vertices = np.zeros((length, 2), np.float_)
 codes = cls.CURVE4 * np.ones((length, ), cls.code_type)
 vertices[1] = [xA[0], yA[0]]
 codes[0:2] = [cls.MOVETO, cls.LINETO]
--
1.7.6
 

--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] ylabel getting cut off when using subplots and figaspect

2011-07-18 Thread Benjamin Root
Came across an oddity here in one of the demos:
http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/tutorial.html#subplotting

In the second subplotting example, there is supposed to be a y-axis label,
but it is being cut off.  In this example, I used plt.figaspect() to set an
appropriate figure aspect for a 2x1 subplot grid.  However, it looks like it
sets the figure too narrow.  The aspect ratio has to be set to around 1.05
before the entire y-axis label appears.  I don't know if this is a bug or
not, but I thought I ought to raise this issue.

Ben Root
--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Another colormap

2011-07-18 Thread Sameer Grover
I came across this website where different colormaps have been compared 
and the author has come up with an optimal colormap for data 
visualization called the "cool-warm colormap".


http://www.cs.unm.edu/~kmorel/documents/ColorMaps/index.html

It is somewhat similar to the cool colormap already included in 
matplotlib, but I've added the new colormap to matplotlib in the patch 
attached in case it is deemed fit to be included in the matplotlib source.


Regards,
Sameer

>From ab71cc83f2e469169d6c392e055ba07b15cadcb4 Mon Sep 17 00:00:00 2001
From: Sameer Grover 
Date: Mon, 18 Jul 2011 22:26:53 +0530
Subject: [PATCH] added coolwarm colormap

---
 lib/matplotlib/_cm.py |  781 +
 1 files changed, 781 insertions(+), 0 deletions(-)

diff --git a/lib/matplotlib/_cm.py b/lib/matplotlib/_cm.py
index 5bea519..6964c07 100644
--- a/lib/matplotlib/_cm.py
+++ b/lib/matplotlib/_cm.py
@@ -1566,6 +1566,786 @@ _gist_yarg_data = {
 'blue': lambda x: 1 - x,
 }
 
+
+_coolwarm_data = {'red': (
+(0.0,0.2298057,0.2298057),
+(0.00390625,0.234299935,0.234299935),
+(0.0078125,0.238810063,0.238810063),
+(0.01171875,0.243336663,0.243336663),
+(0.015625,0.247880265,0.247880265),
+(0.01953125,0.25244136,0.25244136),
+(0.0234375,0.257020396,0.257020396),
+(0.02734375,0.261617779,0.261617779),
+(0.03125,0.26623388,0.26623388),
+(0.03515625,0.270869029,0.270869029),
+(0.0390625,0.275523523,0.275523523),
+(0.04296875,0.28019762,0.28019762),
+(0.046875,0.284891546,0.284891546),
+(0.05078125,0.289605495,0.289605495),
+(0.0546875,0.294339624,0.294339624),
+(0.05859375,0.299094064,0.299094064),
+(0.0625,0.30386891,0.30386891),
+(0.06640625,0.308664231,0.308664231),
+(0.0703125,0.313480065,0.313480065),
+(0.07421875,0.318316422,0.318316422),
+(0.078125,0.323173283,0.323173283),
+(0.08203125,0.328050603,0.328050603),
+(0.0859375,0.332948312,0.332948312),
+(0.08984375,0.337866311,0.337866311),
+(0.09375,0.342804478,0.342804478),
+(0.09765625,0.347762667,0.347762667),
+(0.1015625,0.352740705,0.352740705),
+(0.10546875,0.357738399,0.357738399),
+(0.109375,0.362755532,0.362755532),
+(0.11328125,0.367791863,0.367791863),
+(0.1171875,0.372847134,0.372847134),
+(0.12109375,0.37792106,0.37792106),
+(0.125,0.38301334,0.38301334),
+(0.12890625,0.38812365,0.38812365),
+(0.1328125,0.39325165,0.39325165),
+(0.13671875,0.398396976,0.398396976),
+(0.140625,0.40355925,0.40355925),
+(0.14453125,0.408738074,0.408738074),
+(0.1484375,0.413933033,0.413933033),
+(0.15234375,0.419143694,0.419143694),
+(0.15625,0.424369608,0.424369608),
+(0.16015625,0.429610311,0.429610311),
+(0.1640625,0.434865321,0.434865321),
+(0.16796875,0.440134144,0.440134144),
+(0.171875,0.445416268,0.445416268),
+(0.17578125,0.450711169,0.450711169),
+(0.1796875,0.456018308,0.456018308),
+(0.18359375,0.461337134,0.461337134),
+(0.1875,0.4708,0.4708),
+(0.19140625,0.472007569,0.472007569),
+(0.1953125,0.477358011,0.477358011),
+(0.19921875,0.482717804,0.482717804),
+(0.203125,0.488086336,0.488086336),
+(0.20703125,0.493462982,0.493462982),
+(0.2109375,0.498847107,0.498847107),
+(0.21484375,0.504238066,0.504238066),
+(0.21875,0.509635204,0.509635204),
+(0.22265625,0.515037856,0.515037856),
+(0.2265625,0.520445349,0.520445349),
+(0.23046875,0.525857,0.525857),
+(0.234375,0.531272118,0.531272118),
+(0.23828125,0.536690004,0.536690004),
+(0.2421875,0.542109949,0.542109949),
+(0.24609375,0.54753124,0.54753124),
+(0.25,0.552953156,0.552953156),
+(0.25390625,0.558374965,0.558374965),
+(0.2578125,0.563795935,0.563795935),
+(0.26171875,0.569215322,0.569215322),
+(0.265625,0.574632379,0.574632379),
+(0.26953125,0.580046354,0.580046354),
+(0.2734375,0.585456486,0.585456486),
+(0.27734375,0.590862011,0.590862011),
+(0.28125,0.596262162,0.596262162),
+(0.28515625,0.601656165,0.601656165),
+(0.2890625,0.607043242,0.607043242),
+(0.29296875,0.61242261,0.61242261),
+(0.296875,0.617793485,0.617793485),
+(0.30078125,0.623155076,0.623155076),
+(0.3046875,0.628506592,0.628506592),
+(0.30859375,0.633847237,0.633847237),
+(0.3125,0.639176211,0.639176211),
+(0.31640625,0.644492714,0.644492714),
+(0.3203125,0.649795942,0.649795942),
+(0.32421875,0.655085089,0.655085089),
+(0.328125,0.660359348,0.660359348),
+(0.33203125,0.665617908,0.665617908),
+(0.3359375,0.670859959,0.670859959),
+(0.33984375,0.676084688,0.676084688),
+(0.34375,0.681291281,0.681291281),
+(0.34765625,0.686478925,0.686478925),
+(0.3515625,0.691646803,0.691646803),
+(0.35546875,0.696794099,0.696794099),
+(0.359375,0.70191,0.70191),
+(0.36328125,0.707023684,0.707023684),
+(0.3671875,0.712104339,0.712104339),
+(0.37109375,0.717161148,0.717161148),
+(0.375,0.722193294,0.722193294),
+(0.37890625,0.727199962,0.727199962),
+(0.3828125,0.732180337,0.732180337),
+(0.38671875,0.737133606,0.737133606),
+(0.390625,0.742058956,0.742058956),
+(0.39453125,0.746955574,0.746955574),
+(0.3984375,0.751822652,0.751822652),
+(0.40234375,0.756659379,0.756659379),
+(0.40625,0.761464949,0.761464949),
+

Re: [matplotlib-devel] Matplotlib-devel Digest, Vol 62, Issue 8

2011-07-18 Thread David Kaplan
Hi,

I will be on vacation with limited email from July 14 to August 7, 2011.

Bonjour,

Je serai en conge du 14 juillet jusqu'au 7 aout, 2011.

--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel