SF.net SVN: matplotlib:[6446] trunk/matplotlib/lib/matplotlib/font_manager. py
Revision: 6446
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6446&view=rev
Author: mdboom
Date: 2008-11-25 15:23:28 + (Tue, 25 Nov 2008)
Log Message:
---
Fix mathtext (bug has existed since r6400 11/12/2008)
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/font_manager.py
Modified: trunk/matplotlib/lib/matplotlib/font_manager.py
===
--- trunk/matplotlib/lib/matplotlib/font_manager.py 2008-11-25 04:03:59 UTC
(rev 6445)
+++ trunk/matplotlib/lib/matplotlib/font_manager.py 2008-11-25 15:23:28 UTC
(rev 6446)
@@ -592,7 +592,7 @@
verbose.report("Cannot handle unicode filenames")
#print >> sys.stderr, 'Bad file is', fpath
continue
-try: prop = ttfFontProperty(fpath, font)
+try: prop = ttfFontProperty(font)
except: continue
fontlist.append(prop)
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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6447] trunk/matplotlib/lib/matplotlib/backend_bases .py
Revision: 6447
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6447&view=rev
Author: jdh2358
Date: 2008-11-25 18:28:13 + (Tue, 25 Nov 2008)
Log Message:
---
fixed a zoom bug in sharex axis
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backend_bases.py
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===
--- trunk/matplotlib/lib/matplotlib/backend_bases.py2008-11-25 15:23:28 UTC
(rev 6446)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py2008-11-25 18:28:13 UTC
(rev 6447)
@@ -269,7 +269,7 @@
gc.set_alpha(rgbFace[-1])
rgbFace = rgbFace[:3]
gc.set_antialiased(antialiaseds[i % Naa])
-
+
if Nurls:
gc.set_url(urls[i % Nurls])
@@ -527,7 +527,7 @@
matlab format string, a html hex color string, or a rgb tuple
"""
return self._rgb
-
+
def get_url(self):
"""
returns a url if one is set, None otherwise
@@ -633,7 +633,7 @@
raise ValueError('Unrecognized linestyle: %s' % style)
self._linestyle = style
self.set_dashes(offset, dashes)
-
+
def set_url(self, url):
"""
Sets the url for links in compatible backends
@@ -1531,7 +1531,7 @@
if event.key == 'f':
self.full_screen_toggle()
-
+
# *h*ome or *r*eset mnemonic
elif event.key == 'h' or event.key == 'r' or event.key == "home":
self.canvas.toolbar.home()
@@ -1883,8 +1883,14 @@
for cur_xypress in self._xypress:
x, y = event.x, event.y
lastx, lasty, a, ind, lim, trans = cur_xypress
+# JDH: I don't know why this is here but I expect to be
+# able to zoomo on any axis that is shared. This was
+# breaking zoom-to-rect on sharex_axis_demo if the zoom
+# happened in ax2 or ax3 so i am replacing the continue
+# with a pass until this is sorted out
if a._sharex or a._sharey:
-continue
+#continue
+pass
# ignore singular clicks - 5 pixels is a threshold
if abs(x-lastx)<5 or abs(y-lasty)<5:
self._xypress = None
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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6448] trunk/matplotlib
Revision: 6448
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6448&view=rev
Author: leejjoon
Date: 2008-11-25 18:56:57 + (Tue, 25 Nov 2008)
Log Message:
---
scatterpoints support in Legend. patch by Erik Tollerud
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2008-11-25 18:28:13 UTC (rev 6447)
+++ trunk/matplotlib/CHANGELOG 2008-11-25 18:56:57 UTC (rev 6448)
@@ -1,3 +1,6 @@
+2008-11-25 Added scatterpoints support in Legend. patch by Erik
+ Tollerud - JJL
+
2008-11-24 Fix crash in log ticking. - MGD
2008-11-20 Added static helper method BrokenHBarCollection.span_where
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-11-25 18:28:13 UTC (rev
6447)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-11-25 18:56:57 UTC (rev
6448)
@@ -83,6 +83,7 @@
def __init__(self, parent, handles, labels,
loc = None,
numpoints = None, # the number of points in the legend
line
+ scatterpoints = 3,# TODO: may be an rcParam
prop = None,
pad = None, # the fractional whitespace inside the
legend border
borderpad = None,
@@ -101,6 +102,7 @@
labels# a list of strings to label the legend
loc # a location code
numpoints = 4 # the number of points in the legend line
+ scatterpoints = 3 # the number of points for the scatterplot legend
prop = FontProperties(size='smaller') # the font property
pad = 0.2 # the fractional whitespace inside the legend border
markerscale = 0.6 # the relative size of legend markers vs. original
@@ -118,10 +120,10 @@
Artist.__init__(self)
-proplist=[numpoints, pad, borderpad, markerscale, labelsep,
+proplist=[numpoints, scatterpoints, pad, borderpad, markerscale,
labelsep,
handlelen, handletextsep, axespad, shadow]
-propnames=['numpoints', 'pad', 'borderpad', 'markerscale', 'labelsep',
-'handlelen', 'handletextsep', 'axespad', 'shadow']
+propnames=['numpoints','scatterpoints', 'pad', 'borderpad',
'markerscale',
+'labelsep', 'handlelen', 'handletextsep', 'axespad', 'shadow']
for name, value in safezip(propnames,proplist):
if value is None:
value=rcParams["legend."+name]
@@ -130,7 +132,9 @@
warnings.warn("Use 'borderpad' instead of 'pad'.",
DeprecationWarning)
# 2008/10/04
if self.numpoints <= 0:
-raise ValueError("numpoints must be >= 0; it was %d"% numpoints)
+raise ValueError("numpoints must be > 0; it was %d"% numpoints)
+if self.scatterpoints <= 0:
+raise ValueError("scatterpoints must be > 0; it was %d"% numpoints)
if prop is None:
self.prop=FontProperties(size=rcParams["legend.fontsize"])
else:
@@ -142,8 +146,8 @@
self._scatteryoffsets = np.array([4./8., 5./8., 3./8.])
else:
self._scatteryoffsets = np.asarray(scatteryoffsets)
-reps = int(self.numpoints / len(self._scatteryoffsets)) + 1
-self._scatteryoffsets = np.tile(self._scatteryoffsets,
reps)[:self.numpoints]
+reps = int(self.scatterpoints / len(self._scatteryoffsets)) + 1
+self._scatteryoffsets = np.tile(self._scatteryoffsets,
reps)[:self.scatterpoints]
if isinstance(parent,Axes):
self.isaxes = True
@@ -261,10 +265,14 @@
# centered marker proxy
for handle, label in safezip(handles, texts):
-if self.numpoints > 1:
-xdata = np.linspace(left, left + self.handlelen,
self.numpoints)
+if isinstance(handle, RegularPolyCollection):
+npoints = self.scatterpoints
+else:
+npoints = self.numpoints
+if npoints > 1:
+xdata = np.linspace(left, left + self.handlelen, npoints)
xdata_marker = xdata
-elif self.numpoints == 1:
+elif npoints == 1:
xdata = np.linspace(left, left + self.handlelen, 2)
xdata_marker = [left + 0.5*self.handlelen]
@@ -326,8 +334,11 @@
# we may need to scale these sizes by "markerscale"
# attribute. But other handle types does not seem
# to care about this attribute and it is currently ignored.
-sizes = [.5*(size_max+size_min), size_max,
- size_min]
+if self.scatterpoints < 4:
+sizes = [.5*(size_max+size_min), s
SF.net SVN: matplotlib:[6449] trunk/matplotlib/lib/matplotlib/backend_bases .py
Revision: 6449 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6449&view=rev Author: mdboom Date: 2008-11-25 19:33:05 + (Tue, 25 Nov 2008) Log Message: --- Remove code that was inadvertently merged from branch. Modified Paths: -- trunk/matplotlib/lib/matplotlib/backend_bases.py Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py === --- trunk/matplotlib/lib/matplotlib/backend_bases.py2008-11-25 18:56:57 UTC (rev 6448) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py2008-11-25 19:33:05 UTC (rev 6449) @@ -1883,14 +1883,7 @@ for cur_xypress in self._xypress: x, y = event.x, event.y lastx, lasty, a, ind, lim, trans = cur_xypress -# JDH: I don't know why this is here but I expect to be -# able to zoomo on any axis that is shared. This was -# breaking zoom-to-rect on sharex_axis_demo if the zoom -# happened in ax2 or ax3 so i am replacing the continue -# with a pass until this is sorted out -if a._sharex or a._sharey: -#continue -pass + # ignore singular clicks - 5 pixels is a threshold if abs(x-lastx)<5 or abs(y-lasty)<5: self._xypress = None 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 the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6450] trunk/matplotlib/lib/matplotlib/mlab.py
Revision: 6450 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6450&view=rev Author: jdh2358 Date: 2008-11-25 19:56:39 + (Tue, 25 Nov 2008) Log Message: --- removed comment from invalid shared axis merge Modified Paths: -- trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/lib/matplotlib/mlab.py === --- trunk/matplotlib/lib/matplotlib/mlab.py 2008-11-25 19:33:05 UTC (rev 6449) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-11-25 19:56:39 UTC (rev 6450) @@ -2460,8 +2460,10 @@ # Get header and remove invalid characters needheader = names is None + if needheader: for row in reader: +#print 'csv2rec', row if len(row) and row[0].startswith(comments): continue headers = row 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 the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6451] trunk/matplotlib/lib/matplotlib/projections/ polar.py
Revision: 6451 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6451&view=rev Author: jdh2358 Date: 2008-11-25 21:13:09 + (Tue, 25 Nov 2008) Log Message: --- added a chance for polar with usetex to remove unicode symbol Modified Paths: -- trunk/matplotlib/lib/matplotlib/projections/polar.py Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py === --- trunk/matplotlib/lib/matplotlib/projections/polar.py2008-11-25 19:56:39 UTC (rev 6450) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py2008-11-25 21:13:09 UTC (rev 6451) @@ -136,7 +136,10 @@ """ def __call__(self, x, pos=None): # \u00b0 : degree symbol -return u"%d\u00b0" % ((x / npy.pi) * 180.0) +if rcParams['text.usetex']: +return r"$%d^\circ$" % ((x / npy.pi) * 180.0) +else: +return u"%d\u00b0" % ((x / npy.pi) * 180.0) class RadialLocator(Locator): """ 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 the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6452] trunk/matplotlib/lib/matplotlib/projections/ polar.py
Revision: 6452 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6452&view=rev Author: jdh2358 Date: 2008-11-25 21:14:13 + (Tue, 25 Nov 2008) Log Message: --- added a chance for polar with usetex to remove unicode symbol Modified Paths: -- trunk/matplotlib/lib/matplotlib/projections/polar.py Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py === --- trunk/matplotlib/lib/matplotlib/projections/polar.py2008-11-25 21:13:09 UTC (rev 6451) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py2008-11-25 21:14:13 UTC (rev 6452) @@ -136,7 +136,7 @@ """ def __call__(self, x, pos=None): # \u00b0 : degree symbol -if rcParams['text.usetex']: +if rcParams['text.usetex'] and not rcParams['text.latex.unicode']: return r"$%d^\circ$" % ((x / npy.pi) * 180.0) else: return u"%d\u00b0" % ((x / npy.pi) * 180.0) 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 the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6453] trunk/matplotlib
Revision: 6453
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6453&view=rev
Author: jdh2358
Date: 2008-11-25 21:43:36 + (Tue, 25 Nov 2008)
Log Message:
---
added rc param axes.unicode_minus
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/projections/polar.py
trunk/matplotlib/lib/matplotlib/rcsetup.py
trunk/matplotlib/lib/matplotlib/ticker.py
trunk/matplotlib/matplotlibrc.template
Added Paths:
---
trunk/matplotlib/examples/api/unicode_minus.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2008-11-25 21:14:13 UTC (rev 6452)
+++ trunk/matplotlib/CHANGELOG 2008-11-25 21:43:36 UTC (rev 6453)
@@ -1,3 +1,6 @@
+2008-11-25 Added rcParam axes.unicode_minus which allows plain hypen
+ for minus when False - JDH
+
2008-11-25 Added scatterpoints support in Legend. patch by Erik
Tollerud - JJL
Added: trunk/matplotlib/examples/api/unicode_minus.py
===
--- trunk/matplotlib/examples/api/unicode_minus.py
(rev 0)
+++ trunk/matplotlib/examples/api/unicode_minus.py 2008-11-25 21:43:36 UTC
(rev 6453)
@@ -0,0 +1,18 @@
+"""
+You can use the proper typesetting unicode minus (see
+http://en.wikipedia.org/wiki/Plus_sign#Plus_sign) or the ASCII hypen
+for minus, which some people prefer. The matplotlibrc param
+axes.unicode_minus controls the default behavior.
+
+The default is to use the unicode minus
+"""
+import numpy as np
+import matplotlib
+import matplotlib.pyplot as plt
+
+matplotlib.rcParams['axes.unicode_minus'] = False
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot(10*np.random.randn(100), 10*np.random.randn(100), 'o')
+ax.set_title('Using hypen instead of unicode minus')
+plt.show()
Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===
--- trunk/matplotlib/lib/matplotlib/projections/polar.py2008-11-25
21:14:13 UTC (rev 6452)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py2008-11-25
21:43:36 UTC (rev 6453)
@@ -139,6 +139,11 @@
if rcParams['text.usetex'] and not rcParams['text.latex.unicode']:
return r"$%d^\circ$" % ((x / npy.pi) * 180.0)
else:
+# we use unicode, rather than mathtext with \circ, so
+# that it will work correctly with any arbitrary font
+# (assuming it has a degree sign), whereas $5\circ$
+# will only work correctly with one of the supported
+# math fonts (Computer Modern and STIX)
return u"%d\u00b0" % ((x / npy.pi) * 180.0)
class RadialLocator(Locator):
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-11-25 21:14:13 UTC (rev
6452)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-11-25 21:43:36 UTC (rev
6453)
@@ -412,6 +412,7 @@
# use scientific notation if log10
# of the axis range is smaller than the
# first or larger than the second
+'axes.unicode_minus': [True, validate_bool],
'polaraxes.grid': [True, validate_bool], # display polar grid or
not
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===
--- trunk/matplotlib/lib/matplotlib/ticker.py 2008-11-25 21:14:13 UTC (rev
6452)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2008-11-25 21:43:36 UTC (rev
6453)
@@ -313,7 +313,7 @@
def fix_minus(self, s):
'use a unicode minus rather than hyphen'
-if rcParams['text.usetex']: return s
+if rcParams['text.usetex'] or not rcParams['axes.unicode_minus']:
return s
else: return s.replace('-', u'\u2212')
def __call__(self, x, pos=None):
Modified: trunk/matplotlib/matplotlibrc.template
===
--- trunk/matplotlib/matplotlibrc.template 2008-11-25 21:14:13 UTC (rev
6452)
+++ trunk/matplotlib/matplotlibrc.template 2008-11-25 21:43:36 UTC (rev
6453)
@@ -205,6 +205,8 @@
#axes.formatter.limits : -7, 7 # use scientific notation if log10
# of the axis range is smaller than the
# first or larger than the second
+#axes.unicode_minus : True# use unicode for the minus symbol
+ # rather than hypen. See
http://en.wikipedia.org/wiki/Plus_sign#Plus_sign
#polaraxes.grid : True# display grid on polar axes
This was sent by the SourceForge.net collaborative development platform, the
world's larg
