You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <md...@us...> - 2008-04-22 15:10:42
|
Revision: 5061
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5061&view=rev
Author: mdboom
Date: 2008-04-22 08:09:24 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Merged revisions 5039-5060 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r5046 | dsdale | 2008-04-18 11:20:03 -0400 (Fri, 18 Apr 2008) | 4 lines
dont remove repaint/update from draw(), or updates to the figure after
the initial draw will be ignored. We need a different solution for the
double drawing problem reported for the Wx and Qt* backends
........
r5050 | dsdale | 2008-04-19 10:22:11 -0400 (Sat, 19 Apr 2008) | 3 lines
improve conversion from str to char*, avoid deprecation warnings during
build
........
r5058 | mdboom | 2008-04-22 11:01:00 -0400 (Tue, 22 Apr 2008) | 2 lines
Fix inconsistency between svg.embed_chars and svg.embed_char_paths
........
r5060 | mdboom | 2008-04-22 11:06:01 -0400 (Tue, 22 Apr 2008) | 2 lines
Fix inconsistency between svg.embed_chars and svg.embed_char_paths
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5038
+ /branches/v0_91_maint:1-5060
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-04-22 15:06:01 UTC (rev 5060)
+++ trunk/matplotlib/CHANGELOG 2008-04-22 15:09:24 UTC (rev 5061)
@@ -3437,3 +3437,4 @@
2003-11-21 - make a dash-dot dict for the GC
2003-12-15 - fix install path bug
+t
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-04-22 15:08:00
|
Revision: 5060
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5060&view=rev
Author: mdboom
Date: 2008-04-22 08:06:01 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Fix inconsistency between svg.embed_chars and svg.embed_char_paths
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/config/mplconfig.py
Modified: branches/v0_91_maint/lib/matplotlib/config/mplconfig.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/config/mplconfig.py 2008-04-22 15:03:25 UTC (rev 5059)
+++ branches/v0_91_maint/lib/matplotlib/config/mplconfig.py 2008-04-22 15:06:01 UTC (rev 5060)
@@ -99,7 +99,7 @@
class svg(TConfig):
image_inline = T.true
image_noscale = T.false
- embed_chars = T.true
+ embed_char_paths = T.true
class lines(TConfig):
linewidth = T.Float(1.0)
@@ -435,7 +435,7 @@
'pdf.fonttype' : (self.tconfig.backend.pdf, 'fonttype'),
'svg.image_inline' : (self.tconfig.backend.svg, 'image_inline'),
'svg.image_noscale' : (self.tconfig.backend.svg, 'image_noscale'),
- 'svg.embed_char_paths' : (self.tconfig.backend.svg, 'embed_chars'),
+ 'svg.embed_char_paths' : (self.tconfig.backend.svg, 'embed_char_paths'),
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-04-22 15:05:42
|
Revision: 5059
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5059&view=rev
Author: mdboom
Date: 2008-04-22 08:03:25 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Fix inconsistency between svg.embed_chars and svg.embed_char_paths
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/config/mplconfig.py
Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-04-22 15:01:00 UTC (rev 5058)
+++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-04-22 15:03:25 UTC (rev 5059)
@@ -99,7 +99,7 @@
class svg(TConfig):
image_inline = T.true
image_noscale = T.false
- embed_chars = T.true
+ embed_char_paths = T.true
class lines(TConfig):
linewidth = T.Float(1.0)
@@ -437,7 +437,7 @@
'pdf.fonttype' : (self.tconfig.backend.pdf, 'fonttype'),
'svg.image_inline' : (self.tconfig.backend.svg, 'image_inline'),
'svg.image_noscale' : (self.tconfig.backend.svg, 'image_noscale'),
- 'svg.embed_char_paths' : (self.tconfig.backend.svg, 'embed_chars'),
+ 'svg.embed_char_paths' : (self.tconfig.backend.svg, 'embed_char_paths'),
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-04-22 15:02:15
|
Revision: 5058
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5058&view=rev
Author: mdboom
Date: 2008-04-22 08:01:00 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Fix inconsistency between svg.embed_chars and svg.embed_char_paths
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/matplotlibrc.template
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-04-22 14:59:03 UTC (rev 5057)
+++ branches/v0_91_maint/CHANGELOG 2008-04-22 15:01:00 UTC (rev 5058)
@@ -1,3 +1,5 @@
+2008-04-22 Use "svg.embed_char_paths" consistently everywhere - MGD
+
2008-04-11 Fix global font rcParam setting after initialization
time. - MGD
Modified: branches/v0_91_maint/matplotlibrc.template
===================================================================
--- branches/v0_91_maint/matplotlibrc.template 2008-04-22 14:59:03 UTC (rev 5057)
+++ branches/v0_91_maint/matplotlibrc.template 2008-04-22 15:01:00 UTC (rev 5058)
@@ -156,7 +156,7 @@
# 'tex': As TeX-like text. Text between $'s will be
# formatted as a TeX math expression.
# This setting has no effect when text.usetex is True.
- # In that case, all text will be sent to TeX for
+ # In that case, all text will be sent to TeX for
# processing.
# The following settings allow you to select the fonts in math mode.
@@ -171,7 +171,7 @@
#mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix',
# 'stixsans' or 'custom'
#mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern
- # fonts when a symbol can not be found in one of
+ # fonts when a symbol can not be found in one of
# the custom math fonts.
### AXES
@@ -291,7 +291,7 @@
# svg backend params
#svg.image_inline : True # write raster image data directly into the svg file
#svg.image_noscale : False # suppress scaling of raster data embedded in SVG
-#svg.embed_chars : True # embed character outlines in the SVG file
+#svg.embed_char_paths : True # embed character outlines in the SVG file
# Set the verbose flags. This controls how much information
# matplotlib gives you at runtime and where it goes. The verbosity
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-04-22 14:59:43
|
Revision: 5057
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5057&view=rev
Author: mdboom
Date: 2008-04-22 07:59:03 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Fix inconsistency between svg.embed_chars and svg.embed_char_paths
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/matplotlibrc.template
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-04-22 12:15:13 UTC (rev 5056)
+++ trunk/matplotlib/CHANGELOG 2008-04-22 14:59:03 UTC (rev 5057)
@@ -1,3 +1,5 @@
+2008-04-22 Use "svg.embed_char_paths" consistently everywhere - MGD
+
2008-04-20 Add support to MaxNLocator for symmetric axis autoscaling. - EF
2008-04-20 Fix double-zoom bug. - MM
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template 2008-04-22 12:15:13 UTC (rev 5056)
+++ trunk/matplotlib/matplotlibrc.template 2008-04-22 14:59:03 UTC (rev 5057)
@@ -292,7 +292,7 @@
# svg backend params
#svg.image_inline : True # write raster image data directly into the svg file
#svg.image_noscale : False # suppress scaling of raster data embedded in SVG
-#svg.embed_chars : True # embed character outlines in the SVG file
+#svg.embed_char_paths : True # embed character outlines in the SVG file
# Set the verbose flags. This controls how much information
# matplotlib gives you at runtime and where it goes. The verbosity
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-04-22 12:15:22
|
Revision: 5056
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5056&view=rev
Author: mdboom
Date: 2008-04-22 05:15:13 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Removing my "bone-headed" "not"s and "or"s. Including "math.h" in an
attempt to get VS2003 working.
Modified Paths:
--------------
trunk/matplotlib/src/_path.cpp
Modified: trunk/matplotlib/src/_path.cpp
===================================================================
--- trunk/matplotlib/src/_path.cpp 2008-04-21 08:17:45 UTC (rev 5055)
+++ trunk/matplotlib/src/_path.cpp 2008-04-22 12:15:13 UTC (rev 5056)
@@ -1,3 +1,6 @@
+#include <limits>
+#include <math.h>
+
#include "agg_py_path_iterator.h"
#include "agg_py_transforms.h"
@@ -997,10 +1000,10 @@
std::swap(bx0, bx1);
if (by1 < by0)
std::swap(by0, by1);
- if (not ((bx1 <= ax0) or
- (by1 <= ay0) or
- (bx0 >= ax1) or
- (by0 >= ay1)))
+ if (!((bx1 <= ax0) ||
+ (by1 <= ay0) ||
+ (bx0 >= ax1) ||
+ (by0 >= ay1)))
++count;
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-21 08:17:48
|
Revision: 5055
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5055&view=rev
Author: efiring
Date: 2008-04-21 01:17:45 -0700 (Mon, 21 Apr 2008)
Log Message:
-----------
Bugfix: set_ticks was not respecting axis orientation
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axis.py
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py 2008-04-21 08:00:03 UTC (rev 5054)
+++ trunk/matplotlib/lib/matplotlib/axis.py 2008-04-21 08:17:45 UTC (rev 5055)
@@ -1060,8 +1060,12 @@
"""
### XXX if the user changes units, the information will be lost here
ticks = self.convert_units(ticks)
- if len(ticks):
- self.set_view_interval(min(ticks), max(ticks))
+ if len(ticks) > 1:
+ xleft, xright = self.get_view_interval()
+ if xright > xleft:
+ self.set_view_interval(min(ticks), max(ticks))
+ else:
+ self.set_view_interval(max(ticks), min(ticks))
if minor:
self.set_minor_locator(FixedLocator(ticks))
return self.get_minor_ticks(len(ticks))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-21 08:00:17
|
Revision: 5054
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5054&view=rev
Author: efiring
Date: 2008-04-21 01:00:03 -0700 (Mon, 21 Apr 2008)
Log Message:
-----------
Support 0-centered axis in MaxNLocator
Modified Paths:
--------------
trunk/matplotlib/API_CHANGES
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/ticker.py
Modified: trunk/matplotlib/API_CHANGES
===================================================================
--- trunk/matplotlib/API_CHANGES 2008-04-20 10:45:32 UTC (rev 5053)
+++ trunk/matplotlib/API_CHANGES 2008-04-21 08:00:03 UTC (rev 5054)
@@ -1,5 +1,8 @@
+ New kwarg, "symmetric", in MaxNLocator
+ allows one require an axis to be centered on zero.
+
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
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-04-20 10:45:32 UTC (rev 5053)
+++ trunk/matplotlib/CHANGELOG 2008-04-21 08:00:03 UTC (rev 5054)
@@ -1,3 +1,5 @@
+2008-04-20 Add support to MaxNLocator for symmetric axis autoscaling. - EF
+
2008-04-20 Fix double-zoom bug. - MM
2008-04-15 Speed up color mapping. - EF
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py 2008-04-20 10:45:32 UTC (rev 5053)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2008-04-21 08:00:03 UTC (rev 5054)
@@ -845,10 +845,14 @@
Select no more than N intervals at nice locations.
"""
- def __init__(self, nbins = 10, steps = None, trim = True, integer=False):
+ def __init__(self, nbins = 10, steps = None,
+ trim = True,
+ integer=False,
+ symmetric=False):
self._nbins = int(nbins)
self._trim = trim
self._integer = integer
+ self._symmetric = symmetric
if steps is None:
self._steps = [1, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10]
else:
@@ -890,6 +894,10 @@
def autoscale(self):
dmin, dmax = self.axis.get_data_interval()
+ if self._symmetric:
+ maxabs = max(abs(dmin), abs(dmax))
+ dmin = -maxabs
+ dmax = maxabs
dmin, dmax = mtransforms.nonsingular(dmin, dmax, expander = 0.05)
return npy.take(self.bin_boundaries(dmin, dmax), [0,-1])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-04-20 10:45:37
|
Revision: 5053
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5053&view=rev
Author: mmetz_bn
Date: 2008-04-20 03:45:32 -0700 (Sun, 20 Apr 2008)
Log Message:
-----------
Fixed double-zoom bug
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-04-20 01:33:46 UTC (rev 5052)
+++ trunk/matplotlib/CHANGELOG 2008-04-20 10:45:32 UTC (rev 5053)
@@ -1,3 +1,5 @@
+2008-04-20 Fix double-zoom bug. - MM
+
2008-04-15 Speed up color mapping. - EF
2008-04-12 Speed up zooming and panning of dense images. - EF
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-04-20 01:33:46 UTC (rev 5052)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-04-20 10:45:32 UTC (rev 5053)
@@ -1508,6 +1508,8 @@
'the release mouse button callback in zoom to rect mode'
if not self._xypress: return
+ last_a = []
+
for cur_xypress in self._xypress:
x, y = event.x, event.y
lastx, lasty, a, ind, lim, trans = cur_xypress
@@ -1526,28 +1528,42 @@
x, y = inverse.transform_point( (x, y) )
Xmin,Xmax=a.get_xlim()
Ymin,Ymax=a.get_ylim()
+
+ # detect twinx,y axes and avoid double zooming
+ twinx, twiny = False, False
+ if last_a:
+ for la in last_a:
+ if a._shared_x_axes.joined(a,la): twinx=True
+ if a._shared_y_axes.joined(a,la): twiny=True
+ last_a.append(a)
- if Xmin < Xmax:
- if x<lastx: x0, x1 = x, lastx
- else: x0, x1 = lastx, x
- if x0 < Xmin: x0=Xmin
- if x1 > Xmax: x1=Xmax
+ if twinx:
+ x0, x1 = Xmin, Xmax
else:
- if x>lastx: x0, x1 = x, lastx
- else: x0, x1 = lastx, x
- if x0 > Xmin: x0=Xmin
- if x1 < Xmax: x1=Xmax
+ if Xmin < Xmax:
+ if x<lastx: x0, x1 = x, lastx
+ else: x0, x1 = lastx, x
+ if x0 < Xmin: x0=Xmin
+ if x1 > Xmax: x1=Xmax
+ else:
+ if x>lastx: x0, x1 = x, lastx
+ else: x0, x1 = lastx, x
+ if x0 > Xmin: x0=Xmin
+ if x1 < Xmax: x1=Xmax
- if Ymin < Ymax:
- if y<lasty: y0, y1 = y, lasty
- else: y0, y1 = lasty, y
- if y0 < Ymin: y0=Ymin
- if y1 > Ymax: y1=Ymax
+ if twiny:
+ y0, y1 = Ymin, Ymax
else:
- if y>lasty: y0, y1 = y, lasty
- else: y0, y1 = lasty, y
- if y0 > Ymin: y0=Ymin
- if y1 < Ymax: y1=Ymax
+ if Ymin < Ymax:
+ if y<lasty: y0, y1 = y, lasty
+ else: y0, y1 = lasty, y
+ if y0 < Ymin: y0=Ymin
+ if y1 > Ymax: y1=Ymax
+ else:
+ if y>lasty: y0, y1 = y, lasty
+ else: y0, y1 = lasty, y
+ if y0 > Ymin: y0=Ymin
+ if y1 < Ymax: y1=Ymax
if self._button_pressed == 1:
a.set_xlim((x0, x1))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-20 01:33:48
|
Revision: 5052
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5052&view=rev
Author: efiring
Date: 2008-04-19 18:33:46 -0700 (Sat, 19 Apr 2008)
Log Message:
-----------
Make FixedFormatter work on colorbar (bug report by Jiacong Huang)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colorbar.py
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-04-20 00:57:40 UTC (rev 5051)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-04-20 01:33:46 UTC (rev 5052)
@@ -351,7 +351,7 @@
b = npy.array(locator())
b, ticks = self._locate(b)
formatter.set_locs(b)
- ticklabels = [formatter(t) for t in b]
+ ticklabels = [formatter(t, i) for i, t in enumerate(b)]
offset_string = formatter.get_offset()
return ticks, ticklabels, offset_string
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-20 00:57:45
|
Revision: 5051
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5051&view=rev
Author: efiring
Date: 2008-04-19 17:57:40 -0700 (Sat, 19 Apr 2008)
Log Message:
-----------
Make alpha work for contour and contourf (thanks to Stephane Raynaud)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2008-04-19 14:22:11 UTC (rev 5050)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2008-04-20 00:57:40 UTC (rev 5051)
@@ -325,7 +325,8 @@
levels = self.label_levels
fslist = self.fslist
trans = self.ax.transData
- _colors = self.label_mappable.to_rgba(self.label_cvalues)
+ _colors = self.label_mappable.to_rgba(self.label_cvalues,
+ alpha=self.alpha)
fmt = self.fmt
for icon, lev, color, cvalue, fsize in zip(self.label_indices,
self.label_levels,
@@ -456,7 +457,8 @@
nchunk = self.nchunk)
col = collections.PolyCollection(nlist,
antialiaseds = (self.antialiased,),
- edgecolors= 'None')
+ edgecolors= 'none',
+ alpha=self.alpha)
self.ax.add_collection(col)
self.collections.append(col)
@@ -469,7 +471,8 @@
nlist = C.trace(level, points = 0)
col = collections.LineCollection(nlist,
linewidths = width,
- linestyle = lstyle)
+ linestyle = lstyle,
+ alpha=self.alpha)
if level < 0.0 and self.monochrome:
ls = mpl.rcParams['contour.negative_linestyle']
@@ -491,8 +494,10 @@
self.to_rgba(self.cvalues, alpha=self.alpha)]
self.tcolors = tcolors
for color, collection in zip(tcolors, self.collections):
+ collection.set_alpha(self.alpha)
collection.set_color(color)
for label, cv in zip(self.cl, self.cl_cvalues):
+ label.set_alpha(self.alpha)
label.set_color(self.label_mappable.to_rgba(cv))
# add label colors
cm.ScalarMappable.changed(self)
@@ -718,11 +723,11 @@
return tlinestyles
def get_alpha(self):
- '''For compatibility with artists, return self.alpha'''
+ '''returns alpha to be applied to all ContourSet artists'''
return self.alpha
def set_alpha(self, alpha):
- '''For compatibility with artists, set self.alpha'''
+ '''sets alpha for all ContourSet artists'''
self.alpha = alpha
self.changed()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-04-19 14:22:20
|
Revision: 5050
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5050&view=rev
Author: dsdale
Date: 2008-04-19 07:22:11 -0700 (Sat, 19 Apr 2008)
Log Message:
-----------
improve conversion from str to char*, avoid deprecation warnings during
build
Modified Paths:
--------------
branches/v0_91_maint/src/_backend_agg.cpp
Modified: branches/v0_91_maint/src/_backend_agg.cpp
===================================================================
--- branches/v0_91_maint/src/_backend_agg.cpp 2008-04-19 14:15:43 UTC (rev 5049)
+++ branches/v0_91_maint/src/_backend_agg.cpp 2008-04-19 14:22:11 UTC (rev 5050)
@@ -2269,7 +2269,7 @@
throw Py::TypeError("Object does not appear to be a 8-bit string path or a Python file-like object");
}
- PyObject_CallFunction(write_method, "s#", pixBuffer, NUMBYTES);
+ PyObject_CallFunction(write_method, (char *)"s#", pixBuffer, NUMBYTES);
Py_XDECREF(write_method);
}
@@ -2282,7 +2282,7 @@
PyObject* write_method = PyObject_GetAttrString(py_file_obj, "write");
PyObject* result = NULL;
if (write_method)
- result = PyObject_CallFunction(write_method, "s#", data, length);
+ result = PyObject_CallFunction(write_method, (char *)"s#", data, length);
Py_XDECREF(write_method);
Py_XDECREF(result);
}
@@ -2292,7 +2292,7 @@
PyObject* flush_method = PyObject_GetAttrString(py_file_obj, "flush");
PyObject* result = NULL;
if (flush_method)
- result = PyObject_CallFunction(flush_method, "");
+ result = PyObject_CallFunction(flush_method, (char *)"");
Py_XDECREF(flush_method);
Py_XDECREF(result);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-04-19 14:15:47
|
Revision: 5049
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5049&view=rev
Author: dsdale
Date: 2008-04-19 07:15:43 -0700 (Sat, 19 Apr 2008)
Log Message:
-----------
cleanup conversion of string to char*, avoid deprecation warnings during
build
Modified Paths:
--------------
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2008-04-19 05:35:00 UTC (rev 5048)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-04-19 14:15:43 UTC (rev 5049)
@@ -1308,7 +1308,7 @@
throw Py::TypeError("Object does not appear to be a 8-bit string path or a Python file-like object");
}
- PyObject_CallFunction(write_method, "s#", pixBuffer, NUMBYTES);
+ PyObject_CallFunction(write_method, (char *)"s#", pixBuffer, NUMBYTES);
Py_XDECREF(write_method);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-19 05:35:03
|
Revision: 5048
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5048&view=rev
Author: efiring
Date: 2008-04-18 22:35:00 -0700 (Fri, 18 Apr 2008)
Log Message:
-----------
Standardize patch argument handling
Setters of properties that have default values (from rcParams)
should use the default if called with argument None.
Also, aliases for setters are provided more concisely.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/patches.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-04-18 20:11:03 UTC (rev 5047)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-04-19 05:35:00 UTC (rev 5048)
@@ -801,7 +801,7 @@
self.axesFrame = self.get_axes_patch()
self.axesFrame.set_figure(self.figure)
- self.axesFrame.set_facecolor(None)
+ self.axesFrame.set_facecolor('none')
self.axesFrame.set_edgecolor(rcParams['axes.edgecolor'])
self.axesFrame.set_linewidth(rcParams['axes.linewidth'])
self.axesFrame.set_transform(self.transAxes)
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py 2008-04-18 20:11:03 UTC (rev 5047)
+++ trunk/matplotlib/lib/matplotlib/patches.py 2008-04-19 05:35:00 UTC (rev 5048)
@@ -50,7 +50,7 @@
linewidth=None,
antialiased = None,
hatch = None,
- fill=1,
+ fill=True,
**kwargs
):
"""
@@ -59,18 +59,16 @@
"""
artist.Artist.__init__(self)
- if edgecolor is None: edgecolor = mpl.rcParams['patch.edgecolor']
- if facecolor is None: facecolor = mpl.rcParams['patch.facecolor']
if linewidth is None: linewidth = mpl.rcParams['patch.linewidth']
if antialiased is None: antialiased = mpl.rcParams['patch.antialiased']
- self._edgecolor = edgecolor
- self._facecolor = facecolor
- self._linewidth = linewidth
- self._antialiased = antialiased
- self._hatch = hatch
- self._combined_transform = transforms.IdentityTransform()
+ self.set_edgecolor(edgecolor)
+ self.set_facecolor(facecolor)
+ self.set_linewidth(linewidth)
+ self.set_antialiased(antialiased)
+ self.set_hatch(hatch)
self.fill = fill
+ self._combined_transform = transforms.IdentityTransform()
if len(kwargs): artist.setp(self, **kwargs)
__init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
@@ -117,47 +115,59 @@
def get_antialiased(self):
return self._antialiased
+ get_aa = get_antialiased
def get_edgecolor(self):
return self._edgecolor
+ get_ec = get_edgecolor
def get_facecolor(self):
return self._facecolor
+ get_fc = get_facecolor
def get_linewidth(self):
return self._linewidth
+ get_lw = get_linewidth
def set_antialiased(self, aa):
"""
Set whether to use antialiased rendering
- ACCEPTS: [True | False]
+ ACCEPTS: [True | False] or None for default
"""
+ if aa is None: aa = mpl.rcParams['patch.antialiased']
self._antialiased = aa
+ set_aa = set_antialiased
def set_edgecolor(self, color):
"""
Set the patch edge color
- ACCEPTS: any matplotlib color
+ ACCEPTS: mpl color spec, or None for default, or 'none' for no color
"""
+ if color is None: color = mpl.rcParams['patch.edgecolor']
self._edgecolor = color
+ set_ec = set_edgecolor
def set_facecolor(self, color):
"""
Set the patch face color
- ACCEPTS: any matplotlib color
+ ACCEPTS: mpl color spec, or None for default, or 'none' for no color
"""
+ if color is None: color = mpl.rcParams['patch.facecolor']
self._facecolor = color
+ set_fc = set_facecolor
def set_linewidth(self, w):
"""
Set the patch linewidth in points
- ACCEPTS: float
+ ACCEPTS: float or None for default
"""
+ if w is None: w = mpl.rcParams['patch.linewidth']
self._linewidth = w
+ set_lw = set_linewidth
def set_fill(self, b):
"""
@@ -240,46 +250,10 @@
"""
raise NotImplementedError('Derived must override')
-
def get_window_extent(self, renderer=None):
return self.get_path().get_extents(self.get_transform())
- def set_lw(self, val):
- 'alias for set_linewidth'
- self.set_linewidth(val)
-
-
- def set_ec(self, val):
- 'alias for set_edgecolor'
- self.set_edgecolor(val)
-
-
- def set_fc(self, val):
- 'alias for set_facecolor'
- self.set_facecolor(val)
-
-
- def get_aa(self):
- 'alias for get_antialiased'
- return self.get_antialiased()
-
-
- def get_lw(self):
- 'alias for get_linewidth'
- return self.get_linewidth()
-
-
- def get_ec(self):
- 'alias for get_edgecolor'
- return self.get_edgecolor()
-
-
- def get_fc(self):
- 'alias for get_facecolor'
- return self.get_facecolor()
-
-
class Shadow(Patch):
def __str__(self):
return "Shadow(%s)"%(str(self.patch))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-18 20:11:10
|
Revision: 5047
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5047&view=rev
Author: efiring
Date: 2008-04-18 13:11:03 -0700 (Fri, 18 Apr 2008)
Log Message:
-----------
Improve color handling in collections, fix scatter bug.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/collections.py
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-04-18 15:20:03 UTC (rev 5046)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-04-18 20:11:03 UTC (rev 5047)
@@ -4134,7 +4134,7 @@
"""
SCATTER(x, y, s=20, c='b', marker='o', cmap=None, norm=None,
vmin=None, vmax=None, alpha=1.0, linewidths=None,
- faceted=True, **kwargs)
+ verts=None, **kwargs)
Supported function signatures:
SCATTER(x, y, **kwargs)
@@ -4187,10 +4187,9 @@
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.
+ vertices for a custom scatter symbol. Alternatively, use the
+ kwarg combination marker=None,verts=verts.
- s is a size argument in points squared.
-
Any or all of x, y, s, and c may be masked arrays, in which
case all masks will be combined and only unmasked points
will be plotted.
@@ -4217,16 +4216,13 @@
required by RegularPolyCollection -- see
collections.RegularPolyCollection for details
- * faceted: if True, will use the default edgecolor for the
- markers. If False, will set the edgecolors to be the same
- as the facecolors.
- This kwarg is deprecated;
- please use the edgecolors kwarg instead:
- shading='flat' --> edgecolors='None'
- shading='faceted --> edgecolors=None
- edgecolors also can be any mpl color or sequence of colors.
+ Optional kwargs control the Collection properties; in
+ particular:
- Optional kwargs control the Collection properties:
+ edgecolors='none' : to plot faces with no outlines
+ facecolors='none' : to plot unfilled outlines
+
+ Here are the standard descriptions of all the Collection kwargs:
%(Collection)s
A Collection instance is returned
@@ -4270,8 +4266,12 @@
else:
scales = s
- if faceted: edgecolors = None
- else: edgecolors = 'None'
+ if faceted:
+ edgecolors = None
+ else:
+ edgecolors = 'none'
+ warnings.warn('''replace "faceted=False" with "edgecolors='none'"''',
+ DeprecationWarning) #2008/04/18
sym = None
symstyle = 0
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-04-18 15:20:03 UTC (rev 5046)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-04-18 20:11:03 UTC (rev 5047)
@@ -77,21 +77,12 @@
artist.Artist.__init__(self)
cm.ScalarMappable.__init__(self, norm, cmap)
- if facecolors is None: facecolors = mpl.rcParams['patch.facecolor']
- if edgecolors is None: edgecolors = mpl.rcParams['patch.edgecolor']
- if linewidths is None: linewidths = (mpl.rcParams['patch.linewidth'],)
- if antialiaseds is None: antialiaseds = (mpl.rcParams['patch.antialiased'],)
- self.set_linestyles(linestyles)
+ self.set_edgecolor(edgecolors)
+ self.set_facecolor(facecolors)
+ self.set_linewidth(linewidths)
+ self.set_linestyle(linestyles)
+ self.set_antialiased(antialiaseds)
- self._facecolors = _colors.colorConverter.to_rgba_array(facecolors)
- if edgecolors == 'None':
- self._edgecolors = self._facecolors
- linewidths = (0,)
- else:
- self._edgecolors = _colors.colorConverter.to_rgba_array(edgecolors)
- self._linewidths = self._get_value(linewidths)
- self._antialiaseds = self._get_value(antialiaseds)
-
self._uniform_offsets = None
self._offsets = npy.array([], npy.float_)
if offsets is not None:
@@ -118,6 +109,17 @@
raise TypeError('val must be a float or nonzero sequence of floats')
+ def _get_bool(self, val):
+ try: return (bool(val), )
+ except TypeError:
+ if cbook.iterable(val) and len(val):
+ try: bool(val[0])
+ except TypeError: pass # raise below
+ else: return val
+
+ raise TypeError('val must be a bool or nonzero sequence of them')
+
+
def get_paths(self):
raise NotImplementedError
@@ -219,6 +221,7 @@
ACCEPTS: float or sequence of floats
"""
+ if lw is None: lw = mpl.rcParams['patch.linewidth']
self._linewidths = self._get_value(lw)
set_lw = set_linewidth = set_linewidths
@@ -263,6 +266,17 @@
self._linestyles = dashes
set_dashes = set_linestyle = set_linestyles
+ def set_antialiased(self, aa):
+ """
+ Set the antialiasing state for rendering.
+
+ ACCEPTS: Boolean or sequence of booleans
+ """
+ if aa is None:
+ aa = mpl.rcParams['patch.antialiased']
+ self._antialiaseds = self._get_bool(aa)
+ set_antialiaseds = set_antialiased
+
def set_color(self, c):
"""
Set both the edgecolor and the facecolor.
@@ -282,6 +296,7 @@
ACCEPTS: matplotlib color arg or sequence of rgba tuples
"""
+ if c is None: c = mpl.rcParams['patch.facecolor']
self._facecolors = _colors.colorConverter.to_rgba_array(c, self._alpha)
set_facecolors = set_facecolor
@@ -298,16 +313,14 @@
ACCEPTS: matplotlib color arg or sequence of rgba tuples
"""
- if c == 'None':
- self._linewidths = (0.0,)
- self._edgecolors = npy.array([])
- else:
- self._edgecolors = _colors.colorConverter.to_rgba_array(c)
+ if c is None: c = mpl.rcParams['patch.edgecolor']
+ self._edgecolors = _colors.colorConverter.to_rgba_array(c, self._alpha)
+
set_edgecolors = set_edgecolor
def set_alpha(self, alpha):
"""
- Set the alpha tranpancies of the collection. Alpha must be
+ Set the alpha tranparencies of the collection. Alpha must be
a float.
ACCEPTS: float
@@ -316,9 +329,14 @@
except TypeError: raise TypeError('alpha must be a float')
else:
artist.Artist.set_alpha(self, alpha)
- if len(self._facecolors):
+ try:
self._facecolors[:, 3] = alpha
- self._edgecolors[:, 3] = alpha
+ except (AttributeError, TypeError, IndexError):
+ pass
+ try:
+ self._edgecolors[:, 3] = alpha
+ except (AttributeError, TypeError, IndexError):
+ pass
def get_linewidths(self):
return self._linewidths
@@ -334,7 +352,7 @@
from scalar data
"""
if self._A is None: return
- if len(self._A.shape)>1:
+ if self._A.ndim > 1:
raise ValueError('Collections can only map rank 1 arrays')
if len(self._facecolors):
self._facecolors = self.to_rgba(self._A, self._alpha)
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-04-18 15:20:03 UTC (rev 5046)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-04-18 20:11:03 UTC (rev 5047)
@@ -314,8 +314,18 @@
Accepts a single mpl color spec or a sequence of specs.
If the sequence is a list or array, the items are changed in place,
but an array copy is still returned.
+
+ Special case to handle "no color": if c is "none" (case-insensitive),
+ then an empty array will be returned. Same for an empty list.
"""
try:
+ if c.lower() == 'none':
+ return npy.zeros((0,4), dtype=npy.float_)
+ except AttributeError:
+ pass
+ if len(c) == 0:
+ return npy.zeros((0,4), dtype=npy.float_)
+ try:
result = [self.to_rgba(c, alpha)]
except ValueError:
# If c is a list it must be maintained as the same list
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-04-18 15:20:19
|
Revision: 5046
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5046&view=rev
Author: dsdale
Date: 2008-04-18 08:20:03 -0700 (Fri, 18 Apr 2008)
Log Message:
-----------
dont remove repaint/update from draw(), or updates to the figure after
the initial draw will be ignored. We need a different solution for the
double drawing problem reported for the Wx and Qt* backends
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py
branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py 2008-04-18 08:18:34 UTC (rev 5045)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py 2008-04-18 15:20:03 UTC (rev 5046)
@@ -129,6 +129,7 @@
if DEBUG: print "FigureCanvasQtAgg.draw", self
self.replot = True
FigureCanvasAgg.draw(self)
+ self.update()
def blit(self, bbox=None):
"""
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py 2008-04-18 08:18:34 UTC (rev 5045)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py 2008-04-18 15:20:03 UTC (rev 5046)
@@ -135,6 +135,7 @@
if DEBUG: print "FigureCanvasQtAgg.draw", self
self.replot = True
FigureCanvasAgg.draw(self)
+ self.repaint(False)
def blit(self, bbox=None):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-18 08:18:36
|
Revision: 5045
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5045&view=rev
Author: efiring
Date: 2008-04-18 01:18:34 -0700 (Fri, 18 Apr 2008)
Log Message:
-----------
Small speed improvement in color mapping.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-04-16 14:05:00 UTC (rev 5044)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-04-18 08:18:34 UTC (rev 5045)
@@ -446,7 +446,11 @@
lut = (self._lut * 255).astype(npy.uint8)
else:
lut = self._lut
- rgba = lut.take(xa, axis=0) # twice as fast as lut[xa]
+ rgba = npy.empty(shape=xa.shape+(4,), dtype=lut.dtype)
+ lut.take(xa, axis=0, mode='clip', out=rgba)
+ # twice as fast as lut[xa];
+ # using the clip or wrap mode and providing an
+ # output array speeds it up a little more.
if vtype == 'scalar':
rgba = tuple(rgba[0,:])
return rgba
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-04-16 14:05:38
|
Revision: 5044
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5044&view=rev
Author: dsdale
Date: 2008-04-16 07:05:00 -0700 (Wed, 16 Apr 2008)
Log Message:
-----------
rollback change in backend_qt4 that got merged from the maint branch
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-04-15 17:41:53 UTC (rev 5043)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-04-16 14:05:00 UTC (rev 5044)
@@ -131,6 +131,7 @@
if DEBUG: print "FigureCanvasQtAgg.draw", self
self.replot = True
FigureCanvasAgg.draw(self)
+ self.update()
def blit(self, bbox=None):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-15 17:42:03
|
Revision: 5043
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5043&view=rev
Author: efiring
Date: 2008-04-15 10:41:53 -0700 (Tue, 15 Apr 2008)
Log Message:
-----------
Speed up color mapping
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-04-13 04:52:41 UTC (rev 5042)
+++ trunk/matplotlib/CHANGELOG 2008-04-15 17:41:53 UTC (rev 5043)
@@ -1,3 +1,5 @@
+2008-04-15 Speed up color mapping. - EF
+
2008-04-12 Speed up zooming and panning of dense images. - EF
2008-04-11 Fix global font rcParam setting after initialization
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-04-13 04:52:41 UTC (rev 5042)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-04-15 17:41:53 UTC (rev 5043)
@@ -446,7 +446,7 @@
lut = (self._lut * 255).astype(npy.uint8)
else:
lut = self._lut
- rgba = lut[xa]
+ rgba = lut.take(xa, axis=0) # twice as fast as lut[xa]
if vtype == 'scalar':
rgba = tuple(rgba[0,:])
return rgba
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-13 04:52:46
|
Revision: 5042
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5042&view=rev
Author: efiring
Date: 2008-04-12 21:52:41 -0700 (Sat, 12 Apr 2008)
Log Message:
-----------
Speed up zooming and panning of dense images.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/image.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-04-13 04:20:54 UTC (rev 5041)
+++ trunk/matplotlib/CHANGELOG 2008-04-13 04:52:41 UTC (rev 5042)
@@ -1,3 +1,5 @@
+2008-04-12 Speed up zooming and panning of dense images. - EF
+
2008-04-11 Fix global font rcParam setting after initialization
time. - MGD
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py 2008-04-13 04:20:54 UTC (rev 5041)
+++ trunk/matplotlib/lib/matplotlib/image.py 2008-04-13 04:52:41 UTC (rev 5042)
@@ -81,6 +81,7 @@
self._extent = extent
self.set_filternorm(filternorm)
self.set_filterrad(filterrad)
+ self._filterrad = filterrad
@@ -122,13 +123,61 @@
if self._A is None:
raise RuntimeError('You must first set the image array or the image attribute')
+ xmin, xmax, ymin, ymax = self.get_extent()
+ dxintv = xmax-xmin
+ dyintv = ymax-ymin
+
+ # the viewport scale factor
+ sx = dxintv/self.axes.viewLim.width
+ sy = dyintv/self.axes.viewLim.height
+ numrows, numcols = self._A.shape[:2]
+ if sx > 2:
+ x0 = (self.axes.viewLim.x0-xmin)/dxintv * numcols
+ ix0 = max(0, int(x0 - self._filterrad))
+ x1 = (self.axes.viewLim.x1-xmin)/dxintv * numcols
+ ix1 = min(numcols, int(x1 + self._filterrad))
+ xslice = slice(ix0, ix1)
+ xmin_old = xmin
+ xmin = xmin_old + ix0*dxintv/numcols
+ xmax = xmin_old + ix1*dxintv/numcols
+ dxintv = xmax - xmin
+ sx = dxintv/self.axes.viewLim.width
+ else:
+ xslice = slice(0, numcols)
+
+ if sy > 2:
+ y0 = (self.axes.viewLim.y0-ymin)/dyintv * numrows
+ iy0 = max(0, int(y0 - self._filterrad))
+ y1 = (self.axes.viewLim.y1-ymin)/dyintv * numrows
+ iy1 = min(numrows, int(y1 + self._filterrad))
+ if self.origin == 'upper':
+ yslice = slice(numrows-iy1, numrows-iy0)
+ else:
+ yslice = slice(iy0, iy1)
+ ymin_old = ymin
+ ymin = ymin_old + iy0*dyintv/numrows
+ ymax = ymin_old + iy1*dyintv/numrows
+ dyintv = ymax - ymin
+ sy = dyintv/self.axes.viewLim.height
+ else:
+ yslice = slice(0, numrows)
+
+ if xslice != self._oldxslice or yslice != self._oldyslice:
+ self._imcache = None
+ self._oldxslice = xslice
+ self._oldyslice = yslice
+
if self._imcache is None:
if self._A.dtype == npy.uint8 and len(self._A.shape) == 3:
- im = _image.frombyte(self._A, 0)
+ im = _image.frombyte(self._A[xslice,yslice,:], 0)
im.is_grayscale = False
else:
- x = self.to_rgba(self._A, self._alpha)
- im = _image.fromarray(x, 0)
+ if self._rgbacache is None:
+ x = self.to_rgba(self._A, self._alpha)
+ self._rgbacache = x
+ else:
+ x = self._rgbacache
+ im = _image.fromarray(x[yslice,xslice], 0)
if len(self._A.shape) == 2:
im.is_grayscale = self.cmap.is_gray()
else:
@@ -150,14 +199,7 @@
im.set_interpolation(self._interpd[self._interpolation])
- xmin, xmax, ymin, ymax = self.get_extent()
- dxintv = xmax-xmin
- dyintv = ymax-ymin
- # the viewport scale factor
- sx = dxintv/self.axes.viewLim.width
- sy = dyintv/self.axes.viewLim.height
-
# the viewport translation
tx = (xmin-self.axes.viewLim.x0)/dxintv * numcols
ty = (ymin-self.axes.viewLim.y0)/dyintv * numrows
@@ -165,18 +207,14 @@
l, b, widthDisplay, heightDisplay = self.axes.bbox.bounds
widthDisplay *= magnification
heightDisplay *= magnification
-
im.apply_translation(tx, ty)
- im.apply_scaling(sx, sy)
# resize viewport to display
rx = widthDisplay / numcols
ry = heightDisplay / numrows
- im.apply_scaling(rx, ry)
-
+ im.apply_scaling(rx*sx, ry*sy)
im.resize(int(widthDisplay+0.5), int(heightDisplay+0.5),
norm=self._filternorm, radius=self._filterrad)
-
return im
@@ -232,6 +270,9 @@
self._A = X
self._imcache =None
+ self._rgbacache = None
+ self._oldxslice = None
+ self._oldyslice = None
def set_array(self, A):
"""
@@ -409,6 +450,12 @@
cm.ScalarMappable.set_cmap(self, norm)
class PcolorImage(martist.Artist, cm.ScalarMappable):
+ '''
+ Make a pcolor-style plot with an irregular rectangular grid.
+
+ This uses a variation of the original irregular image code,
+ and it is used by pcolorfast for the corresponding grid type.
+ '''
def __init__(self, ax,
x=None,
y=None,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-13 04:20:59
|
Revision: 5041
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5041&view=rev
Author: efiring
Date: 2008-04-12 21:20:54 -0700 (Sat, 12 Apr 2008)
Log Message:
-----------
Fixed bug revealed by last bugfix in ListedColormap
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-04-12 18:48:37 UTC (rev 5040)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-04-13 04:20:54 UTC (rev 5041)
@@ -550,6 +550,7 @@
self.colors = [self.colors] * N
self.monochrome = True
elif cbook.iterable(self.colors):
+ self.colors = list(self.colors) # in case it was a tuple
if len(self.colors) == 1:
self.monochrome = True
if len(self.colors) < N:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-04-12 18:48:39
|
Revision: 5040
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5040&view=rev
Author: efiring
Date: 2008-04-12 11:48:37 -0700 (Sat, 12 Apr 2008)
Log Message:
-----------
Bugfix and docstring addition for ListedColormap
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colors.py
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py 2008-04-11 15:32:03 UTC (rev 5039)
+++ trunk/matplotlib/lib/matplotlib/colors.py 2008-04-12 18:48:37 UTC (rev 5040)
@@ -530,6 +530,15 @@
"""
def __init__(self, colors, name = 'from_list', N = None):
"""
+ Make a colormap from a list of colors.
+
+ colors is a list of matplotlib color specifications
+ name is a string to identify the colormap
+ N is the number of entries in the map. The default is None,
+ in which case there is one colormap entry for each
+ element in the list of colors. If N < len(colors)
+ the list will be truncated at N. If N > len(colors),
+ the list will be extended by repetition.
"""
self.colors = colors
self.monochrome = False # True only if all colors in map are identical;
@@ -545,7 +554,7 @@
self.monochrome = True
if len(self.colors) < N:
self.colors = list(self.colors) * N
- del(self.colors[N:])
+ del(self.colors[N:])
else:
try: gray = float(self.colors)
except TypeError: pass
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-04-11 15:32:08
|
Revision: 5039
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5039&view=rev
Author: mdboom
Date: 2008-04-11 08:32:03 -0700 (Fri, 11 Apr 2008)
Log Message:
-----------
Merged revisions 5026-5038 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r5028 | jdh2358 | 2008-04-03 11:24:20 -0400 (Thu, 03 Apr 2008) | 1 line
some small fixes to excel tools
........
r5032 | jrevans | 2008-04-07 18:26:21 -0400 (Mon, 07 Apr 2008) | 2 lines
Fixed the double draw bug.
........
r5033 | jdh2358 | 2008-04-09 14:54:54 -0400 (Wed, 09 Apr 2008) | 1 line
small fix for vlines w/ len 1 args
........
r5038 | mdboom | 2008-04-11 11:24:57 -0400 (Fri, 11 Apr 2008) | 3 lines
Fixing global font rcParam setting after initialization time (thanks
to Lev Givon and Eric Firing for finding this)
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/rec_groupby_demo.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
trunk/matplotlib/lib/matplotlib/font_manager.py
trunk/matplotlib/lib/matplotlib/mlab.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5025
+ /branches/v0_91_maint:1-5038
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-04-11 15:24:57 UTC (rev 5038)
+++ trunk/matplotlib/CHANGELOG 2008-04-11 15:32:03 UTC (rev 5039)
@@ -1,7 +1,10 @@
-2008-04-11 Revert commits 5002 and 5031, which were intended to
- avoid an unnecessary call to draw(). 5002 broke saving
+2008-04-11 Fix global font rcParam setting after initialization
+ time. - MGD
+
+2008-04-11 Revert commits 5002 and 5031, which were intended to
+ avoid an unnecessary call to draw(). 5002 broke saving
figures before show(). 5031 fixed the problem created in
- 5002, but broke interactive plotting. Unnecessary call to
+ 5002, but broke interactive plotting. Unnecessary call to
draw still needs resolution - DSD
2008-04-07 Improve color validation in rc handling, suggested
Modified: trunk/matplotlib/examples/rec_groupby_demo.py
===================================================================
--- trunk/matplotlib/examples/rec_groupby_demo.py 2008-04-11 15:24:57 UTC (rev 5038)
+++ trunk/matplotlib/examples/rec_groupby_demo.py 2008-04-11 15:32:03 UTC (rev 5039)
@@ -6,14 +6,20 @@
r.sort()
def daily_return(prices):
+ 'an array of daily returns from price array'
g = np.zeros_like(prices)
g[1:] = (prices[1:]-prices[:-1])/prices[:-1]
return g
def volume_code(volume):
+ 'code the continuous volume data categorically'
ind = np.searchsorted([1e5,1e6, 5e6,10e6, 1e7], volume)
return ind
+# a list of (dtype_name, summary_function, output_dtype_name).
+# rec_summarize will call on each function on the indicated recarray
+# attribute, and the result assigned to output name in the return
+# record array.
summaryfuncs = (
('date', lambda x: [thisdate.year for thisdate in x], 'years'),
('date', lambda x: [thisdate.month for thisdate in x], 'months'),
@@ -24,6 +30,10 @@
rsum = mlab.rec_summarize(r, summaryfuncs)
+# stats is a list of (dtype_name, function, output_dtype_name).
+# rec_groupby will summarize the attribute identified by the
+# dtype_name over the groups in the groupby list, and assign the
+# result to the output_dtype_name
stats = (
('dreturn', len, 'rcnt'),
('dreturn', np.mean, 'rmean'),
@@ -31,6 +41,7 @@
('dreturn', np.std, 'rsigma'),
)
+# you can summarize over a single variable, like years or months
print 'summary by years'
ry = mlab.rec_groupby(rsum, ('years',), stats)
print mlab. rec2txt(ry)
@@ -39,6 +50,7 @@
rm = mlab.rec_groupby(rsum, ('months',), stats)
print mlab.rec2txt(rm)
+# or over multiple variables like years and months
print 'summary by year and month'
rym = mlab.rec_groupby(rsum, ('years','months'), stats)
print mlab.rec2txt(rym)
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-04-11 15:24:57 UTC (rev 5038)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-04-11 15:32:03 UTC (rev 5039)
@@ -2592,11 +2592,10 @@
xmax = npy.asarray(xmax)
if len(xmin)==1:
- xmin = xmin*npy.ones(y.shape, y.dtype)
+ xmin = npy.resize( xmin, y.shape )
if len(xmax)==1:
- xmax = xmax*npy.ones(y.shape, y.dtype)
+ xmax = npy.resize( xmax, y.shape )
-
if len(xmin)!=len(y):
raise ValueError, 'xmin and y are unequal sized sequences'
if len(xmax)!=len(y):
@@ -2660,9 +2659,9 @@
ymin = npy.asarray(ymin)
ymax = npy.asarray(ymax)
if len(ymin)==1:
- ymin = ymin*npy.ones(x.shape, x.dtype)
+ ymin = npy.resize( ymin, x.shape )
if len(ymax)==1:
- ymax = ymax*npy.ones(x.shape, x.dtype)
+ ymax = npy.resize( ymax, x.shape )
if len(ymin)!=len(x):
raise ValueError, 'ymin and x are unequal sized sequences'
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-04-11 15:24:57 UTC (rev 5038)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-04-11 15:32:03 UTC (rev 5039)
@@ -131,7 +131,6 @@
if DEBUG: print "FigureCanvasQtAgg.draw", self
self.replot = True
FigureCanvasAgg.draw(self)
- self.update()
def blit(self, bbox=None):
"""
Modified: trunk/matplotlib/lib/matplotlib/font_manager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/font_manager.py 2008-04-11 15:24:57 UTC (rev 5038)
+++ trunk/matplotlib/lib/matplotlib/font_manager.py 2008-04-11 15:32:03 UTC (rev 5039)
@@ -625,20 +625,6 @@
fontconfig.
"""
- class FontPropertiesSet(object):
- """This class contains all of the default properties at the
- class level, which are then overridden (only if provided) at
- the instance level."""
- family = rcParams['font.' + rcParams['font.family']]
- if is_string_like(family):
- family = [family]
- slant = [rcParams['font.style']]
- variant = [rcParams['font.variant']]
- weight = [rcParams['font.weight']]
- stretch = [rcParams['font.stretch']]
- size = [rcParams['font.size']]
- file = None
-
def __init__(self,
family = None,
style = None,
@@ -649,12 +635,17 @@
fname = None, # if this is set, it's a hardcoded filename to use
_init = None # used only by copy()
):
+ self._family = None
+ self._slant = None
+ self._variant = None
+ self._weight = None
+ self._stretch = None
+ self._size = None
+ self._file = None
- self.__props = self.FontPropertiesSet()
-
# This is used only by copy()
if _init is not None:
- self.__props.__dict__.update(_init)
+ self.__dict__.update(_init.__dict__)
return
if is_string_like(family):
@@ -666,9 +657,8 @@
stretch is None and
size is None and
fname is None):
- self.__props.__dict__ = self._parse_fontconfig_pattern(family)
+ self.set_fontconfig_pattern(family)
return
- family = [family]
self.set_family(family)
self.set_style(style)
@@ -682,7 +672,7 @@
return parse_fontconfig_pattern(pattern)
def __hash__(self):
- return hash(repr(self.__props.__dict__))
+ return hash(repr(self.__dict__))
def __str__(self):
return self.get_fontconfig_pattern()
@@ -690,7 +680,12 @@
def get_family(self):
"""Return a list of font names that comprise the font family.
"""
- return self.__props.family
+ if self._family is None:
+ family = rcParams['font.family']
+ if is_string_like(family):
+ return [family]
+ return family
+ return self._family
def get_name(self):
"""Return the name of the font that best matches the font properties."""
@@ -698,38 +693,45 @@
def get_style(self):
"""Return the font style. Values are: normal, italic or oblique."""
- return self.__props.slant[0]
+ if self._slant is None:
+ return rcParams['font.style']
+ return self._slant
def get_variant(self):
"""Return the font variant. Values are: normal or small-caps."""
- return self.__props.variant[0]
+ if self._variant is None:
+ return rcParams['font.variant']
+ return self._variant
def get_weight(self):
"""
Return the font weight. See the FontProperties class for a
a list of possible values.
"""
- return self.__props.weight[0]
+ if self._weight is None:
+ return rcParams['font.weight']
+ return self._weight
def get_stretch(self):
"""
Return the font stretch or width. Options are: normal,
narrow, condensed, or wide.
"""
- return self.__props.stretch[0]
+ if self._stretch is None:
+ return rcParams['font.stretch']
+ return self._stretch
def get_size(self):
"""Return the font size."""
- return float(self.__props.size[0])
+ if self._size is None:
+ return rcParams['font.size']
+ return float(self._size)
def get_file(self):
- if self.__props.file is not None:
- return self.__props.file[0]
- else:
- return None
+ return self._file
def get_fontconfig_pattern(self):
- return generate_fontconfig_pattern(self.__props.__dict__)
+ return generate_fontconfig_pattern(self)
def set_family(self, family):
"""
@@ -738,58 +740,49 @@
fantasy, or monospace, or a real font name.
"""
if family is None:
- self.__props.__dict__.pop('family', None)
+ self._family = None
else:
if is_string_like(family):
family = [family]
- self.__props.family = family
+ self._family = family
set_name = set_family
def set_style(self, style):
"""Set the font style. Values are: normal, italic or oblique."""
- if style is None:
- self.__props.__dict__.pop('style', None)
- else:
- if style not in ('normal', 'italic', 'oblique'):
- raise ValueError("style must be normal, italic or oblique")
- self.__props.slant = [style]
+ if style not in ('normal', 'italic', 'oblique', None):
+ raise ValueError("style must be normal, italic or oblique")
+ self._slant = style
def set_variant(self, variant):
"""Set the font variant. Values are: normal or small-caps."""
- if variant is None:
- self.__props.__dict__.pop('variant', None)
- else:
- if variant not in ('normal', 'small-caps'):
- raise ValueError("variant must be normal or small-caps")
- self.__props.variant = [variant]
+ if variant not in ('normal', 'small-caps', None):
+ raise ValueError("variant must be normal or small-caps")
+ self._variant = variant
def set_weight(self, weight):
"""
Set the font weight. See the FontProperties class for a
a list of possible values.
"""
- if weight is None:
- self.__props.__dict__.pop('weight', None)
- else:
- if (weight not in weight_dict and
- weight not in weight_dict.keys()):
- raise ValueError("weight is invalid")
- self.__props.weight = [weight]
+ if (weight is not None and
+ weight not in weight_dict and
+ weight not in weight_dict.keys()):
+ raise ValueError("weight is invalid")
+ self._weight = weight
def set_stretch(self, stretch):
"""
Set the font stretch or width. Options are: normal, narrow,
condensed, or wide.
"""
- if stretch is None:
- self.__props.__dict__.pop('stretch', None)
- else:
- self.__props.stretch = [stretch]
+ if stretch not in ('normal', 'narrow', 'condensed', 'wide', None):
+ raise ValueError("stretch is invalid")
+ self._stretch = stretch
def set_size(self, size):
"""Set the font size."""
if size is None:
- self.__props.__dict__.pop('size', None)
+ self._size = None
else:
if is_string_like(size):
parent_size = fontManager.get_default_size()
@@ -797,28 +790,25 @@
if scaling is not None:
size = parent_size * scaling
else:
- size = parent_size
- if isinstance(size, (int, float)):
- size = [size]
- self.__props.size = size
+ try:
+ size = float(size)
+ except ValueError:
+ size = parent_size
+ assert(type(size) in (int, float))
+ self._size = size
def set_file(self, file):
- if file is None:
- self.__props.__dict__.pop('file', None)
- else:
- self.__props.file = [file]
+ self._file = file
get_size_in_points = get_size
def set_fontconfig_pattern(self, pattern):
- self.__props.__dict__ = self._parse_fontconfig_pattern(pattern)
+ for key, val in self._parse_fontconfig_pattern(pattern).items():
+ getattr(self, "set_" + key)(val)
- def add_property_pair(self, key, val):
- self.__props.setdefault(key, []).append(val)
-
def copy(self):
"""Return a deep copy of self"""
- return FontProperties(_init = self.__props.__dict__)
+ return FontProperties(_init = self)
def ttfdict_to_fnames(d):
'flatten a ttfdict to all the filenames it contains'
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py 2008-04-11 15:24:57 UTC (rev 5038)
+++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-04-11 15:32:03 UTC (rev 5039)
@@ -1948,7 +1948,6 @@
except NotImplementedError: return False
else: return b
-
def rec_append_field(rec, name, arr, dtype=None):
'return a new record array with field name populated with data from array arr'
arr = npy.asarray(arr)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-04-11 15:25:11
|
Revision: 5038
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5038&view=rev
Author: mdboom
Date: 2008-04-11 08:24:57 -0700 (Fri, 11 Apr 2008)
Log Message:
-----------
Fixing global font rcParam setting after initialization time (thanks
to Lev Givon and Eric Firing for finding this)
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/lib/matplotlib/font_manager.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-04-11 15:16:16 UTC (rev 5037)
+++ branches/v0_91_maint/CHANGELOG 2008-04-11 15:24:57 UTC (rev 5038)
@@ -1,3 +1,6 @@
+2008-04-11 Fix global font rcParam setting after initialization
+ time. - MGD
+
2008-03-27 Fix saving to Unicode filenames with Agg backend
(other backends appear to already work...)
(Thanks, Christopher Barker) - MGD
Modified: branches/v0_91_maint/lib/matplotlib/font_manager.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/font_manager.py 2008-04-11 15:16:16 UTC (rev 5037)
+++ branches/v0_91_maint/lib/matplotlib/font_manager.py 2008-04-11 15:24:57 UTC (rev 5038)
@@ -625,20 +625,6 @@
fontconfig.
"""
- class FontPropertiesSet(object):
- """This class contains all of the default properties at the
- class level, which are then overridden (only if provided) at
- the instance level."""
- family = rcParams['font.' + rcParams['font.family']]
- if is_string_like(family):
- family = [family]
- slant = [rcParams['font.style']]
- variant = [rcParams['font.variant']]
- weight = [rcParams['font.weight']]
- stretch = [rcParams['font.stretch']]
- size = [rcParams['font.size']]
- file = None
-
def __init__(self,
family = None,
style = None,
@@ -649,12 +635,17 @@
fname = None, # if this is set, it's a hardcoded filename to use
_init = None # used only by copy()
):
+ self._family = None
+ self._slant = None
+ self._variant = None
+ self._weight = None
+ self._stretch = None
+ self._size = None
+ self._file = None
- self.__props = self.FontPropertiesSet()
-
# This is used only by copy()
if _init is not None:
- self.__props.__dict__.update(_init)
+ self.__dict__.update(_init.__dict__)
return
if is_string_like(family):
@@ -666,9 +657,8 @@
stretch is None and
size is None and
fname is None):
- self.__props.__dict__ = self._parse_fontconfig_pattern(family)
+ self.set_fontconfig_pattern(family)
return
- family = [family]
self.set_family(family)
self.set_style(style)
@@ -682,7 +672,7 @@
return parse_fontconfig_pattern(pattern)
def __hash__(self):
- return hash(repr(self.__props.__dict__))
+ return hash(repr(self.__dict__))
def __str__(self):
return self.get_fontconfig_pattern()
@@ -690,7 +680,12 @@
def get_family(self):
"""Return a list of font names that comprise the font family.
"""
- return self.__props.family
+ if self._family is None:
+ family = rcParams['font.family']
+ if is_string_like(family):
+ return [family]
+ return family
+ return self._family
def get_name(self):
"""Return the name of the font that best matches the font properties."""
@@ -698,38 +693,45 @@
def get_style(self):
"""Return the font style. Values are: normal, italic or oblique."""
- return self.__props.slant[0]
+ if self._slant is None:
+ return rcParams['font.style']
+ return self._slant
def get_variant(self):
"""Return the font variant. Values are: normal or small-caps."""
- return self.__props.variant[0]
+ if self._variant is None:
+ return rcParams['font.variant']
+ return self._variant
def get_weight(self):
"""
Return the font weight. See the FontProperties class for a
a list of possible values.
"""
- return self.__props.weight[0]
+ if self._weight is None:
+ return rcParams['font.weight']
+ return self._weight
def get_stretch(self):
"""
Return the font stretch or width. Options are: normal,
narrow, condensed, or wide.
"""
- return self.__props.stretch[0]
+ if self._stretch is None:
+ return rcParams['font.stretch']
+ return self._stretch
def get_size(self):
"""Return the font size."""
- return float(self.__props.size[0])
+ if self._size is None:
+ return rcParams['font.size']
+ return float(self._size)
def get_file(self):
- if self.__props.file is not None:
- return self.__props.file[0]
- else:
- return None
+ return self._file
def get_fontconfig_pattern(self):
- return generate_fontconfig_pattern(self.__props.__dict__)
+ return generate_fontconfig_pattern(self)
def set_family(self, family):
"""
@@ -738,58 +740,49 @@
fantasy, or monospace, or a real font name.
"""
if family is None:
- self.__props.__dict__.pop('family', None)
+ self._family = None
else:
if is_string_like(family):
family = [family]
- self.__props.family = family
+ self._family = family
set_name = set_family
def set_style(self, style):
"""Set the font style. Values are: normal, italic or oblique."""
- if style is None:
- self.__props.__dict__.pop('style', None)
- else:
- if style not in ('normal', 'italic', 'oblique'):
- raise ValueError("style must be normal, italic or oblique")
- self.__props.slant = [style]
+ if style not in ('normal', 'italic', 'oblique', None):
+ raise ValueError("style must be normal, italic or oblique")
+ self._slant = style
def set_variant(self, variant):
"""Set the font variant. Values are: normal or small-caps."""
- if variant is None:
- self.__props.__dict__.pop('variant', None)
- else:
- if variant not in ('normal', 'small-caps'):
- raise ValueError("variant must be normal or small-caps")
- self.__props.variant = [variant]
+ if variant not in ('normal', 'small-caps', None):
+ raise ValueError("variant must be normal or small-caps")
+ self._variant = variant
def set_weight(self, weight):
"""
Set the font weight. See the FontProperties class for a
a list of possible values.
"""
- if weight is None:
- self.__props.__dict__.pop('weight', None)
- else:
- if (weight not in weight_dict and
- weight not in weight_dict.keys()):
- raise ValueError("weight is invalid")
- self.__props.weight = [weight]
+ if (weight is not None and
+ weight not in weight_dict and
+ weight not in weight_dict.keys()):
+ raise ValueError("weight is invalid")
+ self._weight = weight
def set_stretch(self, stretch):
"""
Set the font stretch or width. Options are: normal, narrow,
condensed, or wide.
"""
- if stretch is None:
- self.__props.__dict__.pop('stretch', None)
- else:
- self.__props.stretch = [stretch]
+ if stretch not in ('normal', 'narrow', 'condensed', 'wide', None):
+ raise ValueError("stretch is invalid")
+ self._stretch = stretch
def set_size(self, size):
"""Set the font size."""
if size is None:
- self.__props.__dict__.pop('size', None)
+ self._size = None
else:
if is_string_like(size):
parent_size = fontManager.get_default_size()
@@ -797,28 +790,25 @@
if scaling is not None:
size = parent_size * scaling
else:
- size = parent_size
- if isinstance(size, (int, float)):
- size = [size]
- self.__props.size = size
+ try:
+ size = float(size)
+ except ValueError:
+ size = parent_size
+ assert(type(size) in (int, float))
+ self._size = size
def set_file(self, file):
- if file is None:
- self.__props.__dict__.pop('file', None)
- else:
- self.__props.file = [file]
+ self._file = file
get_size_in_points = get_size
def set_fontconfig_pattern(self, pattern):
- self.__props.__dict__ = self._parse_fontconfig_pattern(pattern)
+ for key, val in self._parse_fontconfig_pattern(pattern).items():
+ getattr(self, "set_" + key)(val)
- def add_property_pair(self, key, val):
- self.__props.setdefault(key, []).append(val)
-
def copy(self):
"""Return a deep copy of self"""
- return FontProperties(_init = self.__props.__dict__)
+ return FontProperties(_init = self)
def ttfdict_to_fnames(d):
'flatten a ttfdict to all the filenames it contains'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-04-11 15:16:40
|
Revision: 5037
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5037&view=rev
Author: dsdale
Date: 2008-04-11 08:16:16 -0700 (Fri, 11 Apr 2008)
Log Message:
-----------
revert commits 5002, 5031
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-04-11 14:56:32 UTC (rev 5036)
+++ trunk/matplotlib/CHANGELOG 2008-04-11 15:16:16 UTC (rev 5037)
@@ -1,3 +1,9 @@
+2008-04-11 Revert commits 5002 and 5031, which were intended to
+ avoid an unnecessary call to draw(). 5002 broke saving
+ figures before show(). 5031 fixed the problem created in
+ 5002, but broke interactive plotting. Unnecessary call to
+ draw still needs resolution - DSD
+
2008-04-07 Improve color validation in rc handling, suggested
by Lev Givon - EF
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-04-11 14:56:32 UTC (rev 5036)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-04-11 15:16:16 UTC (rev 5037)
@@ -131,6 +131,7 @@
if DEBUG: print "FigureCanvasQtAgg.draw", self
self.replot = True
FigureCanvasAgg.draw(self)
+ self.update()
def blit(self, bbox=None):
"""
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-04-11 14:56:32 UTC (rev 5036)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-04-11 15:16:16 UTC (rev 5037)
@@ -136,6 +136,7 @@
if DEBUG: print "FigureCanvasQtAgg.draw", self
self.replot = True
FigureCanvasAgg.draw(self)
+ self.repaint(False)
def blit(self, bbox=None):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|