~ubuntu-branches/ubuntu/gutsy/matplotlib/gutsy

« back to all changes in this revision

Viewing changes to examples/polar_demo.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2007-07-31 23:04:56 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070731230456-lfmr0h69yh1i37w1
Tags: 0.90.1-2ubuntu1
* Merge from Debian unstable. Remaining changes:
  + debian/rules:
    - Check only the files for the python version which just got installed
      (fixes FTBFS).
    - Modify Maintainer value to match DebianMaintainerField spec.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
# See the pylab rgrids and thetagrids functions for
40
40
# information on how to customize the grid locations and labels
41
41
 
42
 
from pylab import *
 
42
import matplotlib.numerix as nx
 
43
from pylab import figure, show, rc
43
44
 
44
45
# radar green, solid grid lines
45
46
rc('grid', color='#316931', linewidth=1, linestyle='-')
46
47
rc('xtick', labelsize=15)
47
48
rc('ytick', labelsize=15)
 
49
 
48
50
# force square figure and square axes looks better for polar, IMO
49
 
figure(figsize=(8,8))
50
 
ax = axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')
51
 
 
52
 
r = arange(0,1,0.001)
53
 
theta = 2*2*pi*r
54
 
polar(theta, r, color='#ee8d18', lw=3)
55
 
 
56
 
title("And there was much rejoicing!", fontsize=20)
57
 
savefig('polar_demo')
 
51
fig = figure(figsize=(8,8))
 
52
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')
 
53
 
 
54
r = nx.arange(0, 3.0, 0.01)
 
55
theta = 2*nx.pi*r
 
56
ax.plot(theta, r, color='#ee8d18', lw=3)
 
57
ax.set_rmax(2.0)
 
58
 
 
59
ax.set_title("And there was much rejoicing!", fontsize=20)
 
60
fig.savefig('polar_demo')
58
61
show()