Trac login is broken for quite a while, so I will reply here. This is quite
easy to patch. For instance, the following patch for the case "frame=False"
and "axes=True" (the default) works:
diff --git a/sage/plot/graphics.py b/sage/plot/graphics.py
--- a/sage/plot/graphics.py
+++ b/sage/plot/graphics.py
@@ -1913,7 +1913,7 @@
raise ValueError('Expand the range of the dependent
variable to allow two multiples of your tick locator (option `ticks`).')
x_formatter, y_formatter = tick_formatter
- from matplotlib.ticker import FuncFormatter
+ from matplotlib.ticker import FuncFormatter, FixedFormatter
from sage.misc.latex import latex
from sage.symbolic.ring import SR
if x_formatter is None:
@@ -1924,6 +1924,8 @@
x_formatter = FuncFormatter(lambda n,pos:_multiple_of_constant
(n,pos,x_const))
elif x_formatter == "latex":
x_formatter = FuncFormatter(lambda n,pos: '$%s$'%latex(n))
+ elif isinstance(x_formatter, (list, tuple)):
+ x_formatter = FixedFormatter(x_formatter)
if y_formatter is None:
y_formatter = OldScalarFormatter()
elif y_formatter in SR:
@@ -1932,6 +1934,8 @@
y_formatter = FuncFormatter(lambda n,pos:_multiple_of_constant
(n,pos,y_const))
elif y_formatter == "latex":
y_formatter = FuncFormatter(lambda n,pos: '$%s$'%latex(n))
+ elif isinstance(y_formatter, (list, tuple)):
+ y_formatter = FixedFormatter(y_formatter)
subplot.xaxis.set_major_locator(x_locator)
subplot.yaxis.set_major_locator(y_locator)
This can be tested with a plot like this:
plot(x, (x,0,2), ticks=[[1,2],[1,2,3.5]], tick_formatter=[["$x_1$","$x_2$"
],["$y_1$","$y_2$","$y_3$"]])
There should probably be more checks like
len(ticks[0]) == len(tick_formatter[0])
and so on, but that can be addressed in a proper patch.
On Saturday, June 2, 2012 9:39:25 AM UTC+8, kcrisman wrote:
>
>
> I've opened http://trac.sagemath.org/sage_trac/ticket/13078 and put this
> code there, in the hope that it will be to someone later on. Thanks!
>
--
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-support
URL: http://www.sagemath.org