Processing math: 100%
Ask Your Question
1

2 Plotting Questions

asked 14 years ago

mhfrey gravatar image

updated 10 years ago

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=('Ω0/ωnut',"Pab"),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.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 14 years ago

DSM gravatar image

updated 14 years ago

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.)

Preview: (hide)
link
0

answered 14 years ago

mhfrey gravatar image

Thank you for your help.

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

Preview: (hide)
link

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: 14 years ago

Seen: 527 times

Last updated: Jan 09 '11