ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 09 Jan 2011 08:57:59 +01002 Plotting Questionshttps://ask.sagemath.org/question/7851/2-plotting-questions/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.Fri, 07 Jan 2011 10:44:15 +0100https://ask.sagemath.org/question/7851/2-plotting-questions/Answer by mhfrey for <p>I have been able to get most things working with:</p>
<p>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]])</p>
<p>I have an additional questions about controlling plot features:</p>
<ol>
<li>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.</li>
<li>How do I get the \rightarrow to display instead of the \Rightarrow? The \Rightarrow, \dashrightarrow and \longrightarrow display properly, I think this a bug.</li>
</ol>
<p>Thank you again for your help.</p>
https://ask.sagemath.org/question/7851/2-plotting-questions/?answer=11948#post-id-11948Thank you for your help.
"axes=false" works great. The \righrarrow is probably something weird with my system.Sun, 09 Jan 2011 08:57:59 +0100https://ask.sagemath.org/question/7851/2-plotting-questions/?answer=11948#post-id-11948Answer by DSM for <p>I have been able to get most things working with:</p>
<p>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]])</p>
<p>I have an additional questions about controlling plot features:</p>
<ol>
<li>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.</li>
<li>How do I get the \rightarrow to display instead of the \Rightarrow? The \Rightarrow, \dashrightarrow and \longrightarrow display properly, I think this a bug.</li>
</ol>
<p>Thank you again for your help.</p>
https://ask.sagemath.org/question/7851/2-plotting-questions/?answer=11940#post-id-11940I'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:
<pre><code>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)
</code></pre>
gives
![simple test plot](/upfiles/1294474319799298.png)
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.)Sat, 08 Jan 2011 03:16:22 +0100https://ask.sagemath.org/question/7851/2-plotting-questions/?answer=11940#post-id-11940