I would like to write the radian units of the axes as proportional to \pi
: something like
$\frac{\pi}{4}$, $\frac{\pi}{2}$, ...
in place of
0.785, 1.5707 ...
Is there any standard way? As an example, what should I add to the following code?
from pylab import *
x=arange(-10.0,10.0,0.1)
y= arctan(x)
plot(x,y,'b.')
show()
I found this example http://matplotlib.sourceforge.net/examples/units/radian_demo.html but it does not work because I don't have basic_units module.
Thank you!
hard code them in fractions or accept floating numbers
the result is