Ask Your Question
0

How to add string tick labels to 2D plots?

asked 2013-03-24 12:48:21 -0500

araichev gravatar image

Hi folks, i want to add string tick labels to a 2D plot, e.g. ['$100', '$200', '$300'] on the x-axis instead of the ticks [1, 2, 3]. I see from http://stackoverflow.com/questions/5439708/python-matplotlib-creating-date-ticks-from-string that i can do this with matplotlib via

from matplotlib import pyplot as plt
plt.plot([1,2,3],[3,4,3])
ax = plt.gca()
ax.set_xticks([1,2,3])
ax.set_xticklabels(['$100','$200','$300'])

Is there a Sage way to accomplish the same thing?

Personally, i find Sage plotting commands more user-friendly than matplotlib commands.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-03-24 15:05:01 -0500

ppurka gravatar image

This functionality is not yet in sage-5.8, but will be in sage-5.9. If you want it now then simply use sage-5.9.beta1, or patch ticket 13078 into your own version of sage.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-03-24 12:48:21 -0500

Seen: 1,006 times

Last updated: Mar 24 '13