On 1/28/11 8:23 AM, kcrisman wrote:
On Jan 28, 11:08 am, Jason Grout<jason-s...@creativetrax.com> wrote:
On 1/28/11 7:20 AM, kcrisman wrote:
On Jan 28, 9:52 am, "D. S. McNeil"<dsm...@gmail.com> wrote:
On Fri, Jan 28, 2011 at 9:08 PM, Jeff wrote:
I would like to be able to plot a function, e.g. plot(sin), that has
axes and ticks on the axes but that does not have labels for the
ticks. I understand that I might be able to do this using a ticker
formatter, perhaps also, by directly using matplotlib, but I do not
know exactly how to go about doing this.
There may be a simpler way, but:
import matplotlib
p = plot(sin)
p.show(tick_formatter=(matplotlib.ticker.NullFormatter(),
matplotlib.ticker.NullFormatter()))
worked for me. The repetition is to make sure that both x and y tick
labels are turned off.
Yes, if you look athttp://www.sagemath.org/doc/reference/sage/plot/plot.html
and search for tick_formatter, you will see documentation for this.
Do you think it would be worth having the null formatter as a
specified option? The string "null" could easily have the default be
the null formatter - that would be easy to add.
I think the string 'none' might be a better fit for matplotlib
conventions, for what it's worth.
But the Python None is already reserved for the default formatter,
which I suppose makes sense since 'no formatting' means 'no special
formatting' to most of us... while null is special. So with 'none'
versus None I see a lot of potential for confusion. Or?
Yes, I do see a possibly confusing point. Advantages are:
1. once people realize that None means default, then the confusion is
lessened.
2. 'none' works for colors and the like since that's the matplotlib
convention.
Actually, (2) doesn't work in Sage, since apparently to_mpl_color
doesn't recognize 'none'. That's a bug in my opinion, as there is no
way to, say, draw a circle with a fill but no surrounding edge.
I'd say 'null' is less intuitive than 'none' (again, once the user
realizes that None actually means default).
Thanks,
Jason
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org