Ask Your Question
1

2 Plotting Questions

asked 2011-01-07 10:44:15 +0100

mhfrey gravatar image

updated 2015-01-14 10:47:59 +0100

FrédéricC gravatar image

I have been able to get most things working with:

list_plot([(r,Pabrf(Ratio=r).n()) for r in srange(-1, 1, 0.1, include_endpoint=True)], plotjoined=True, frame=true, ymin=0,axes_labels=('$\Omega _{0}/\omega _{nut}$',"$ P _{a\rightarrow b}$"),ticks=[[-1, -0.5,0,0.5,1],[0.2,0.4,0.6,0.8,1.0]])

I have an additional questions about controlling plot features:

  1. How do I turn off or turn on the lines at the origin(0)? I can find nothing in the Matplotlib docs that mentions this.
  2. How do I get the \rightarrow to display instead of the \Rightarrow? The \Rightarrow, \dashrightarrow and \longrightarrow display properly, I think this a bug.

Thank you again for your help.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2011-01-08 03:16:22 +0100

DSM gravatar image

updated 2011-01-08 03:16:53 +0100

I'm not quite sure I understand. For (1), do you want the x=0 and y=0 lines turned off? Then axes=False should do it. And for (2), rightarrow seems to work for me:

p = list_plot([(r,Pabrf(Ratio=r).n()) for r in srange(-1, 1, 0.1, include_endpoint=True)], plotjoined=True, frame=true)
p.show(ymin=0, axes_labels=('$\\Omega_0/\\omega_{\\mathrm{nut}}$', "$P_{a \\rightarrow b}$"), axes=False)

gives

simple test plot

Is something like this what you're after or do we need to try harder? I may have copied the function itself wrong, so you don't need to worry about the blue line. :^)

I also second the recommendation that working with matplotlib/pylab directly is probably easier when you want to do a lot of configuring. (To tell the truth, I'm having trouble getting Sage to save plots the way they look on my screen.)

edit flag offensive delete link more
0

answered 2011-01-09 08:57:59 +0100

mhfrey gravatar image

Thank you for your help.

"axes=false" works great. The \righrarrow is probably something weird with my system.

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: 2011-01-07 10:44:15 +0100

Seen: 497 times

Last updated: Jan 09 '11