|
From: Scott S. <sco...@gm...> - 2009-10-15 07:50:37
|
>2009/10/15 Marie-Therese Horstmann <mho...@un...>:
> I currently experience some problem with arrows in polar
> plots.
>
> ---------------------------------------------------------------------------
> Source code to reproduce the zero direction "arrow"
>
> import matplotlib
> import numpy as np
> from matplotlib.pyplot import figure, show, rc, grid
>
> # radar green, solid grid lines
> rc('grid', color='#316931', linewidth=1, linestyle='-')
> rc('xtick', labelsize=15)
> rc('ytick', labelsize=15)
>
> # force square figure and square axes looks better for
> polar, IMO
> width, height = matplotlib.rcParams['figure.figsize']
> size = min(width, height)
> # make a square figure
> fig = figure(figsize=(size, size))
> ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True,
> axisbg='#d5de9c')
>
> r = np.arange(0, 3.0, 0.01)
> theta = 2*np.pi*r
> ax.plot(theta, r, color='#ee8d18', lw=3)
> ax.set_rmax(2.0)
> grid(True)
>
> ax.set_title("And there was much rejoicing!", fontsize=20)
> #This is the line I added:
> arr = plt.arrow(0, 0.5, 0,1 , alpha = 0.5, width = 0.1,
> edgecolor = 'black', facecolor = 'green',lw = 2)
arr = ax.arrow(0, 0.5, 0, 1, alpha = 0.5, width = 0.1 ...
>
> show()
This works fine for me with matplotlib version 0.99.0 (see attached).
What version are you using?
import matplotlib
print matplotlib.__version__
Cheers,
Scott
|