ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 09 Feb 2018 21:08:29 -0600How to draw geometrical figures with coordinate axeshttp://ask.sagemath.org/question/41053/how-to-draw-geometrical-figures-with-coordinate-axes/ I would like to draw geometrical figures with coordinate axes. suppose I want to draw a sphere with three coordinate axes x,y,z. How can I do this?MKSFri, 09 Feb 2018 21:08:29 -0600http://ask.sagemath.org/question/41053/How to enforce limits to the x-axis in plots?http://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 06:07:12 -0500http://ask.sagemath.org/question/33032/swap axes in 2d plothttp://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>JoalHeagneySun, 30 Nov 2014 23:05:59 -0600http://ask.sagemath.org/question/25066/axis_thickness ?http://ask.sagemath.org/question/23762/axis_thickness/I would like to like to increase the thickness of my axes on my plots. How might I do this?
Background: I am a teacher who uses sage to make my own graph paper. The axes look good on paper (although I'd like to have arrows on them), but when I project the pdf onto my white board (to draw on) the axes don't look much thicker than the gridlines (I'm using greyed instead of dashed gridlines). Here's my code:
k = 8
p = plot(k, (x, -k, k),
thickness = 0,
aspect_ratio = 1,
gridlines = True,
axes_labels=['$x$','$y$'],
ticks=[[-k..k],[-k..k]],
tick_formatter = [['$-8$', '', '$-6$', '', '$-4$', '', '$-2$', '', '', '', '$2$', '', '$4$', '', '$6$', '', '$8$'], ['$-8$', '', '$-6$', '', '$-4$', '', '$-2$', '', '', '', '$2$', '', '$4$', '', '$6$', '', '$8$']],
gridlinesstyle = dict(color = "gray", linestyle = "-")
)
p += plot(0, (x, -k, k), thickness = 0) #to establish graph width
p += plot(-k, (x, -k, k), thickness = 0) #to establish graph height
show(p)
p.save('graph8l.pdf')mathochistWed, 13 Aug 2014 13:34:15 -0500http://ask.sagemath.org/question/23762/Axes 'disappear'http://ask.sagemath.org/question/10741/axes-disappear/Is there any way to 'disappear' the axes, 2d or 3d, leaving the graphic freestanding.JimSat, 16 Nov 2013 14:07:48 -0600http://ask.sagemath.org/question/10741/modify axe scalehttp://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 03:31:08 -0500http://ask.sagemath.org/question/10246/jmol axes off-centerhttp://ask.sagemath.org/question/10017/jmol-axes-off-center/Hi,
I'm new to Sage, and as I was trying to figure out plot3d and jmol, I noticed that when the axes are switched on, they appear off-center (if you put a point on the origin, it becomes quite obvious). I looked around to see if anyone else had noted this bug, and found this [report](http://trac.sagemath.org/sage_trac/ticket/5229) from four years ago! I take it, then, that this problem won't be corrected in the foreseeable future, and I was wondering whether anyone has discovered a workaround.
Thanks!planarianSat, 13 Apr 2013 02:31:07 -0500http://ask.sagemath.org/question/10017/Disabling y-axes in 2-D plothttp://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 03:55:04 -0600http://ask.sagemath.org/question/9803/How can matplotlib graph axis be moved?http://ask.sagemath.org/question/9142/how-can-matplotlib-graph-axis-be-moved/Hello! I created test simple plot with matplotlib on www.sagenb.com using the following sintax:
import matplotlib.pyplot as plt
plt.plot([1, 3, 2, 4])
plt.savefig('1.png')
By default the axes are around the graph. But I want axes to be intersected at (0,0) point. I tried to find answer at matplotlib online documentation but not found.
**Upd_1:**
I would like to explain my problem more detail.
Original graph has frame around it. Axes of this graph are located on the graph bordes. I want frame to be switched off and axis lines to be intersected at (0,0) point. Such graphs are drawn with Sage by default (I'm glad to upload some pictures, but my karma isn't enough to do it). Thanks to the help of [fidelbc](http://ask.sagemath.org/users/382/fidelbc/) I typed the following code:
import matplotlib.pyplot as plt
plt.clf()
plt.plot([0, 5, 10, 15,20,25], [0, 5, 0, -5, 0, 5], linewidth=2, color='blue')
plt.box('off')
plt.grid(True)
plt.axhline(y=0, color='black')
plt.axvline(x=0, color='black')
plt.savefig('1.png')
New graph responds my idea at more extent and I want to draw arrows on axes and ticks with its label to be located near new horisontal axes. Please help me to set these parameters or just move graph axis. Thanks.AndreWinSat, 07 Jul 2012 06:50:21 -0500http://ask.sagemath.org/question/9142/Set axes in 3d plothttp://ask.sagemath.org/question/8997/set-axes-in-3d-plot/Is there a way to set the kind of axes shown in a 3d plot? Seems like you should be able to specify boxed, axes, etc. in the `show` command.calc314Wed, 23 May 2012 09:57:23 -0500http://ask.sagemath.org/question/8997/Two Y-axeshttp://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 09:17:35 -0600http://ask.sagemath.org/question/8571/Add little arrow tips at the end of the coordinate axeshttp://ask.sagemath.org/question/8494/add-little-arrow-tips-at-the-end-of-the-coordinate-axes/Is it possible to add little arrow tips to the end of the coordinate axes?sagefanSat, 19 Nov 2011 07:56:22 -0600http://ask.sagemath.org/question/8494/2 Plotting Questionshttp://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 03:44:15 -0600http://ask.sagemath.org/question/7851/