SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

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
S M T W T F S
1
(3)
2
(2)
3
(6)
4
(4)
5
(1)
6
7
8
9
10
11
(1)
12
(1)
13
(1)
14
(4)
15
16
(8)
17
(7)
18
(5)
19
20
21
(2)
22
23
(2)
24
25
(2)
26
(6)
27
(3)
28
(2)
29
(2)
30
(2)
31




Showing 1 results of 1

From: <jr...@us...> - 2010年08月05日 17:04:22
Revision: 8624
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8624&view=rev
Author: jrevans
Date: 2010年08月05日 17:04:14 +0000 (2010年8月05日)
Log Message:
-----------
Added keyword arguments 'thetaunits' and 'runits' for polar plots.
Fixed PolarAxes so that when it set default Formatters, it marked them as such.
Fixed semilogx and semilogy to no longer blindly reset the ticker information on the non-log axis.
Axes.arrow can now accept unitized data.
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/lib/matplotlib/projections/polar.py
 trunk/matplotlib/lib/matplotlib/testing/jpl_units/UnitDblConverter.py
 trunk/matplotlib/lib/matplotlib/tests/test_axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2010年08月04日 12:36:13 UTC (rev 8623)
+++ trunk/matplotlib/CHANGELOG	2010年08月05日 17:04:14 UTC (rev 8624)
@@ -1,3 +1,10 @@
+2010年08月05日 Added keyword arguments 'thetaunits' and 'runits' for polar
+ plots. Fixed PolarAxes so that when it set default
+ Formatters, it marked them as such. Fixed semilogx and
+ semilogy to no longer blindly reset the ticker information
+ on the non-log axis. Axes.arrow can now accept unitized
+ data. - JRE
+
 2010年08月03日 Add support for MPLSETUPCFG variable for custom setup.cfg
 filename. Used by sage buildbot to build an mpl w/ no gui
 support - JDH
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2010年08月04日 12:36:13 UTC (rev 8623)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2010年08月05日 17:04:14 UTC (rev 8624)
@@ -178,7 +178,11 @@
 
 if self.axes.xaxis is not None and self.axes.yaxis is not None:
 xunits = kwargs.pop( 'xunits', self.axes.xaxis.units)
+ if self.axes.name == 'polar':
+ xunits = kwargs.pop( 'thetaunits', xunits )
 yunits = kwargs.pop( 'yunits', self.axes.yaxis.units)
+ if self.axes.name == 'polar':
+ yunits = kwargs.pop( 'runits', yunits )
 if xunits!=self.axes.xaxis.units:
 self.axes.xaxis.set_units(xunits)
 if yunits!=self.axes.yaxis.units:
@@ -1554,6 +1558,8 @@
 # process kwargs 2nd since these will override default units
 if kwargs is not None:
 xunits = kwargs.pop( 'xunits', self.xaxis.units)
+ if self.name == 'polar':
+ xunits = kwargs.pop( 'thetaunits', xunits )
 if xunits!=self.xaxis.units:
 #print '\tkw setting xunits', xunits
 self.xaxis.set_units(xunits)
@@ -1563,6 +1569,8 @@
 self.xaxis.update_units(xdata)
 
 yunits = kwargs.pop('yunits', self.yaxis.units)
+ if self.name == 'polar':
+ yunits = kwargs.pop( 'runits', yunits )
 if yunits!=self.yaxis.units:
 #print '\tkw setting yunits', yunits
 self.yaxis.set_units(yunits)
@@ -3953,7 +3961,6 @@
 }
 
 self.set_xscale('log', **d)
- self.set_yscale('linear')
 b = self._hold
 self._hold = True # we've already processed the hold
 l = self.plot(*args, **kwargs)
@@ -4004,7 +4011,6 @@
 'nonposy': kwargs.pop('nonposy', 'mask'),
 }
 self.set_yscale('log', **d)
- self.set_xscale('linear')
 b = self._hold
 self._hold = True # we've already processed the hold
 l = self.plot(*args, **kwargs)
@@ -6286,6 +6292,13 @@
 
 .. plot:: mpl_examples/pylab_examples/arrow_demo.py
 """
+ # Strip away units for the underlying patch since units
+ # do not make sense to most patch-like code
+ x = self.convert_xunits(x)
+ y = self.convert_yunits(y)
+ dx = self.convert_xunits(dx)
+ dy = self.convert_yunits(dy)
+
 a = mpatches.FancyArrow(x, y, dx, dy, **kwargs)
 self.add_artist(a)
 return a
Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/polar.py	2010年08月04日 12:36:13 UTC (rev 8623)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py	2010年08月05日 17:04:14 UTC (rev 8624)
@@ -220,6 +220,7 @@
 self.title.set_y(1.05)
 
 self.xaxis.set_major_formatter(self.ThetaFormatter())
+ self.xaxis.isDefault_majfmt = True
 angles = np.arange(0.0, 360.0, 45.0)
 self.set_thetagrids(angles)
 self.yaxis.set_major_locator(self.RadialLocator(self.yaxis.get_major_locator()))
Modified: trunk/matplotlib/lib/matplotlib/testing/jpl_units/UnitDblConverter.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/testing/jpl_units/UnitDblConverter.py	2010年08月04日 12:36:13 UTC (rev 8623)
+++ trunk/matplotlib/lib/matplotlib/testing/jpl_units/UnitDblConverter.py	2010年08月05日 17:04:14 UTC (rev 8624)
@@ -79,11 +79,7 @@
 else:
 label = None
 
- if ( label == "rad" ):
- # If the axis units are in radians, then use a special function for
- # applying format control.
- majfmt = ticker.FuncFormatter( rad_fn )
- elif ( label == "deg" ) and isinstance( axis.axes, polar.PolarAxes ):
+ if ( label == "deg" ) and isinstance( axis.axes, polar.PolarAxes ):
 # If we want degrees for a polar plot, use the PolarPlotFormatter
 majfmt = polar.PolarAxes.ThetaFormatter()
 else:
Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/tests/test_axes.py	2010年08月04日 12:36:13 UTC (rev 8623)
+++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py	2010年08月05日 17:04:14 UTC (rev 8624)
@@ -279,10 +279,12 @@
 @image_comparison(baseline_images=['polar_units'])
 def test_polar_units():
 import matplotlib.testing.jpl_units as units
+ from nose.tools import assert_true
 units.register()
 
 pi = np.pi
 deg = units.UnitDbl( 1.0, "deg" )
+ km = units.UnitDbl( 1.0, "km" )
 
 x1 = [ pi/6.0, pi/4.0, pi/3.0, pi/2.0 ]
 x2 = [ 30.0*deg, 45.0*deg, 60.0*deg, 90.0*deg ]
@@ -299,6 +301,12 @@
 
 fig.savefig( 'polar_units' )
 
+ # make sure runits and theta units work
+ y1 = [ y*km for y in y1 ]
+ plt.polar( x2, y1, color = "blue", thetaunits="rad", runits="km" )
+ assert_true( isinstance(plt.gca().get_xaxis().get_major_formatter(), units.UnitDblFormatter) )
+
+
 @image_comparison(baseline_images=['polar_rmin'])
 def test_polar_rmin():
 r = np.arange(0, 3.0, 0.01)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 1 results of 1

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /