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.Thu, 07 Apr 2016 13:07:12 +0200How to enforce limits to the x-axis in plots?https://ask.sagemath.org/question/33032/how-to-enforce-limits-to-the-x-axis-in-plots/I want to plot a function, say $ f(x) = \frac{1}{x} $, in a certain interval, $ x \in [-2, 2] $, but produce the resulting plot in a broader interval, $ x \in [-3, 3] $, and store it as a graphical file. This case occurs, e.g., when a function is well-defined only in a certain region, but the plot should illustrate a broader region.
Currently, I pass the new $x$-axis range via `show` as follows:
p = plot(1/x, (x, -2, 2), ymax = 10, ymin = -10, exclude = [0])
p.show(xmin = -3, xmax = 3)
p.save("plot.svg")
Is it possible to change the $x$-axis range in a more direct way (without using `show`)? For instance,
p = plot(1/x, (x, -2, 2), ymax = 10, ymin = -10, exclude = [0])
p.xmin = -3
p.xmax = 3
p.save("plot.svg")PhilosophiĆ¦ NaturalisThu, 07 Apr 2016 13:07:12 +0200https://ask.sagemath.org/question/33032/swap axes in 2d plothttps://ask.sagemath.org/question/25066/swap-axes-in-2d-plot/<p>Hi guys. Just playing around with titration curves in water, which is a remarkably difficult problem to do.</p>
<p>Basically I can derive an equation for volume of base versus pH of solution, and plot it.</p>
<p>However, I'd like to swap the x and y axes.</p>
<p>Or do I have to use implicit_plot? :(</p>JoalHeagneyMon, 01 Dec 2014 06:05:59 +0100https://ask.sagemath.org/question/25066/modify axe scalehttps://ask.sagemath.org/question/10246/modify-axe-scale/Hello,
I would like to choose which numbers appear on the axes of a graphics. If I do
sage: G = Graphics()
sage: G.set_axes_range(xmin=0,xmax=10,ymin=0,ymax=1)
sage: G.show()
Then the x axis has a small separation each 2 (ie the numbers 0,2,4,6,8,10 appear). What should I do to get it 3 (ie separation at 0,3,6,9) ?
ThanksvdelecroixMon, 17 Jun 2013 10:31:08 +0200https://ask.sagemath.org/question/10246/Disabling y-axes in 2-D plothttps://ask.sagemath.org/question/9803/disabling-y-axes-in-2-d-plot/Hi all,
is it possible to switch of the y-axes seperately in a 2-D plot? The intuitive way
plot(exp,axes=[True,False])
is the very same as
plot(exp,axes=True)
Greetings,
MarkuspinwheelWed, 13 Feb 2013 10:55:04 +0100https://ask.sagemath.org/question/9803/Two Y-axeshttps://ask.sagemath.org/question/8571/two-y-axes/ Hello!
Could somebody please point me to a way of plotting two curves associated with different y-axes?
I need to plot two curves with different scale over the y-axis to compare their form. What I was thinking of is having two separate y-axes on both sides of a plot and associating one of the curves with the left axis and the other one - with the right axis. Is that possible?
Thank you.v_2eFri, 16 Dec 2011 16:17:35 +0100https://ask.sagemath.org/question/8571/2 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.mhfreyFri, 07 Jan 2011 10:44:15 +0100https://ask.sagemath.org/question/7851/