Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3de3b6

Browse files
committed
added polar plots
svn path=/trunk/matplotlib/; revision=608
1 parent 580d94a commit c3de3b6

15 files changed

+811
-277
lines changed

.matplotlibrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ axes.linewidth : 1.0 # edge linewidth
132132
axes.grid : False # display grid or not
133133
axes.titlesize : 14 # fontsize of the axes title
134134
axes.labelsize : 12 # fontsize of the x any y labels
135-
axes.labelcolor : k # black
135+
axes.labelcolor : k # black
136+
137+
polaraxes.grid : True # display grid on polar axes
136138

137139
### TICKS
138140
tick.major.size : 4 # major tick size in points

CHANGELOG

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
New entries should be added at the top
22

33
==============================================================
4+
2004-10-21 Added polar axes and plots - JDH
5+
46
2004-10-20 Fixed corrcoef bug exposed by corrcoef(X) where X is matrix
57
- JDH
68

@@ -13,7 +15,7 @@ New entries should be added at the top
1315
to avoid masking problems with shared libraries. - JTM
1416

1517
2004-10-16 Streamlined the matlab interface wrapper, removed the
16-
noplot option to hist - just use mlab.hist instead.
18+
noplot option to hist - just use mlab.hist instead.
1719

1820
2004-09-30 Added Andrew Dalke's strftime code to extend the range of
1921
dates supported by the DateFormatter - JDH

examples/polar_demo.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env python
2+
#
3+
# matplotlib now has a PolarAxes class and a polar function in the
4+
# matplotlib interface. This is considered alpha and the interface
5+
# may change as we work out how polar axes should best be integrated
6+
#
7+
# The only function that has been tested on polar axes is "plot" (the
8+
# matlab interface function "polar" calls ax.plot where ax is a
9+
# PolarAxes) -- other axes plotting functions may work on PolarAxes
10+
# but haven't been tested and may need tweaking.
11+
#
12+
# you can get get a PolarSubplot instance by doing, for example
13+
#
14+
# subplot(211, polar=True)
15+
#
16+
# or a PolarAxes instance by doing
17+
# axes([left, bottom, width, height], polar=True)
18+
#
19+
# The view limits (eg xlim and ylim) apply to the lower left and upper
20+
# right of the rectangular box that surrounds to polar axes. Eg if
21+
# you have
22+
#
23+
# r = arange(0,1,0.01)
24+
# theta = 2*pi*r
25+
#
26+
# the lower left corner is 5/4pi, sqrt(2) and the
27+
# upper right corner is 1/4pi, sqrt(2)
28+
#
29+
# you could change the radial bounding box (zoom out) by setting the
30+
# ylim (radial coordinate is the second argument to the plot command,
31+
# as in matlab, though this is not advised currently because it is not
32+
# clear to me how the axes should behave in the change of view limits.
33+
# Please advise me if you have opinions. Likewise, the pan/zoom
34+
# controls probably do not do what you think they do and are better
35+
# left alone on polar axes. Perhaps I will disable them for polar
36+
# axes unless we come up with a meaningful, useful and functional
37+
# implementation for them.
38+
39+
from matplotlib.matlab import *
40+
41+
r = arange(0,4,0.001)
42+
theta = 6*pi*r
43+
polar(theta, r)
44+
title("It's about time!")
45+
savefig('polar_demo')
46+
show()

lib/matplotlib/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ def validate_verbose_erro(s):
526526
'axes.labelsize' : ['medium', validate_fontsize], # fontsize of the x any y labels
527527
'axes.labelcolor' : ['k', validate_color], # color of axis label
528528

529+
'polaraxes.grid' : [True, validate_bool], # display grid or not
530+
529531
# tick properties
530532
'tick.major.size' : [5, validate_float], # major tick size in points
531533
'tick.minor.size' : [2, validate_float], # minor tick size in points

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def set_clip_on(self, b):
7070

7171
def draw(self, renderer, *args, **kwargs):
7272
'Derived classes drawing method'
73-
raise NotImplementedError, 'Derived must override'
73+
pass
7474

7575
def set_alpha(self, alpha):
7676
"""

0 commit comments

Comments
 (0)