SF.net SVN: matplotlib: [4938] trunk/matplotlib/lib/matplotlib/backends/ backend_ps.py

2008-02-04 Thread mdboom
Revision: 4938
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4938&view=rev
Author:   mdboom
Date: 2008-02-04 11:53:07 -0800 (Mon, 04 Feb 2008)

Log Message:
---
Fix Postscript graphics context bug (Thanks Paul Novak for finding this)

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py  2008-02-04 
07:25:08 UTC (rev 4937)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py  2008-02-04 
19:53:07 UTC (rev 4938)
@@ -759,6 +759,15 @@
 fill = (fill and rgbFace is not None and
 (len(rgbFace) <= 3 or rgbFace[3] != 0.0))
 
+if stroke or gc.get_linewidth() > 0.0:
+self.set_linewidth(gc.get_linewidth())
+jint = gc.get_joinstyle()
+self.set_linejoin(jint)
+cint = gc.get_capstyle()
+self.set_linecap(cint)
+self.set_linedash(*gc.get_dashes())
+self.set_color(*gc.get_rgb()[:3])
+
 cliprect = gc.get_clip_rectangle()
 if cliprect:
 x,y,w,h=cliprect.bounds
@@ -782,14 +791,7 @@
 self.set_color(store=0, *rgbFace[:3])
 write("fill\ngrestore\n")
 
-if stroke and gc.get_linewidth() > 0.0:
-self.set_linewidth(gc.get_linewidth())
-jint = gc.get_joinstyle()
-self.set_linejoin(jint)
-cint = gc.get_capstyle()
-self.set_linecap(cint)
-self.set_linedash(*gc.get_dashes())
-self.set_color(*gc.get_rgb()[:3])
+if stroke or gc.get_linewidth() > 0.0:
 write("stroke\n")
 else:
 write("newpath\n")


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4940] trunk/matplotlib/examples/contourf_log.py

2008-02-04 Thread efiring
Revision: 4940
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4940&view=rev
Author:   efiring
Date: 2008-02-04 23:54:01 -0800 (Mon, 04 Feb 2008)

Log Message:
---
New example to illustrate log scale for contour levels.

Added Paths:
---
trunk/matplotlib/examples/contourf_log.py

Added: trunk/matplotlib/examples/contourf_log.py
===
--- trunk/matplotlib/examples/contourf_log.py   (rev 0)
+++ trunk/matplotlib/examples/contourf_log.py   2008-02-05 07:54:01 UTC (rev 
4940)
@@ -0,0 +1,48 @@
+'''
+Demonstrate use of a log color scale in contourf
+'''
+
+from matplotlib import pyplot as P
+import numpy as npy
+from numpy import ma
+from matplotlib import colors, ticker
+from matplotlib.mlab import bivariate_normal
+
+N = 100
+x = npy.linspace(-3.0, 3.0, N)
+y = npy.linspace(-2.0, 2.0, N)
+
+X, Y = npy.meshgrid(x, y)
+
+# A low hump with a spike coming out of the top right.
+# Needs to have z/colour axis on a log scale so we see both hump and spike.
+# linear scale only shows the spike.
+z = (bivariate_normal(X, Y, 0.1, 0.2, 1.0, 1.0)
++ 0.1 * bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0))
+
+# Put in some negative values (lower left corner) to cause trouble with logs:
+z[:5, :5] = -1
+
+# The following is not strictly essential, but it will eliminate
+# a warning.  Comment it out to see the warning.
+z = ma.masked_where(z<= 0, z)
+
+
+# Automatic selection of levels works; setting the
+# log locator tells contourf to use a log scale:
+cs = P.contourf(X, Y, z, locator=ticker.LogLocator())
+
+# Alternatively, you can manually set the levels
+# and the norm:
+#lev_exp = npy.arange(npy.floor(npy.log10(z.min())-1),
+#   npy.ceil(npy.log10(z.max())+1))
+#levs = npy.power(10, lev_exp)
+#cs = P.contourf(X, Y, z, levs, norm=colors.LogNorm())
+
+#The 'extend' kwarg does not work yet with a log scale.
+
+cbar = P.colorbar()
+
+P.show()
+
+


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [4939] trunk/matplotlib/lib/matplotlib/contour.py

2008-02-04 Thread efiring
Revision: 4939
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4939&view=rev
Author:   efiring
Date: 2008-02-04 23:34:39 -0800 (Mon, 04 Feb 2008)

Log Message:
---
Bugfix in contour auto level selection via locator

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/contour.py

Modified: trunk/matplotlib/lib/matplotlib/contour.py
===
--- trunk/matplotlib/lib/matplotlib/contour.py  2008-02-04 19:53:07 UTC (rev 
4938)
+++ trunk/matplotlib/lib/matplotlib/contour.py  2008-02-05 07:34:39 UTC (rev 
4939)
@@ -514,12 +514,11 @@
 self.locator = ticker.LogLocator()
 else:
 self.locator = ticker.MaxNLocator(N+1)
-self.locator.create_dummy_axis()
-locator = self.locator
+self.locator.create_dummy_axis()
 zmax = self.zmax
 zmin = self.zmin
-locator.set_bounds(zmin, zmax)
-lev = locator()
+self.locator.set_bounds(zmin, zmax)
+lev = self.locator()
 zmargin = (zmax - zmin) * 0.01 # so z < (zmax + zmargin)
 if zmax >= lev[-1]:
 lev[-1] += zmargin


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins