#1431: basic plotting: add support for setting the location and labels of all
tick
marks on the x and y axes
---------------------------+------------------------------------------------
Reporter: was | Owner: was
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.3
Component: graphics | Keywords:
Work_issues: | Author:
Reviewer: | Merged:
---------------------------+------------------------------------------------
Changes (by jason):
* status: new => needs_work
Comment:
Still needs doctest examples.
Example:
{{{
def multiple_of_pi(n,pos):
m = n*1.0/float(pi)
c=[i for i in convergents(m) if i.denominator()<12]
q=c[-1]
if q.denominator()==1:
if q.numerator()==1:
return r'$\pi$'
elif q.numerator()==-1:
return r'$-\pi$'
else:
return r'$%s\pi$'%q
else:
if q.numerator()==1:
return r'$\frac{\pi}{%s}$'%q.denominator()
elif q.numerator()==-1:
return r'$\frac{-\pi}{%s}$'%q.denominator()
else:
return r'$\frac{%s\pi}{%s}$'%(q.numerator(),q.denominator())
from matplotlib.ticker import MultipleLocator, FuncFormatter
plot(sin(x), (x, -4, 4), tick_locator=MultipleLocator(float(pi/3)),
tick_formatter=FuncFormatter(multiple_of_pi))
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/1431#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---