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.Sat, 22 Oct 2011 00:35:43 +0200Limiting the display range of a 3d plothttps://ask.sagemath.org/question/7575/limiting-the-display-range-of-a-3d-plot/Is there any way to limit the display range of a 3d plot,
using either jmol or tachyon? (Something similar to xmax
and ymax with a 2d plot.) Wed, 18 Aug 2010 20:08:20 +0200https://ask.sagemath.org/question/7575/limiting-the-display-range-of-a-3d-plot/Answer by William Stein for <p>Is there any way to limit the display range of a 3d plot,
using either jmol or tachyon? (Something similar to xmax
and ymax with a 2d plot.) </p>
https://ask.sagemath.org/question/7575/limiting-the-display-range-of-a-3d-plot/?answer=11374#post-id-11374I'm pretty sure the answer to this question is: "no". Robert Bradshaw and I implemented almost all of the 3D plotting code, and I specifically remembering not getting to this. I also just looked at the relevant source code and didn't see anything:
sage: f(x,y)=x^2+y^2
sage: G = plot3d(f, (-1,1), (-2,2))
sage: G.show??
By the way, the way this *should* work once it is implemented is that you'll type
sage: G.show(zmax=2)
and the plot would get cutoff at 2 instead of at 5 like it is currently shown.
I'm also not sure what the best way to implement this is. For some renderers it might easy -- just pass an option on to clip the viewing rectangle. One could also try to clip the 3d scene itself, but this could be arbitrarily hard.
Wed, 18 Aug 2010 20:26:40 +0200https://ask.sagemath.org/question/7575/limiting-the-display-range-of-a-3d-plot/?answer=11374#post-id-11374Answer by process91 for <p>Is there any way to limit the display range of a 3d plot,
using either jmol or tachyon? (Something similar to xmax
and ymax with a 2d plot.) </p>
https://ask.sagemath.org/question/7575/limiting-the-display-range-of-a-3d-plot/?answer=12795#post-id-12795I ran into this issue recently, and I ended up implicitly plotting a simple function like
sage: implicit_plot3d(x,(x,-10,10),(y,-10,10),(z,-10,10),opacity=0)+...
(where the ... were the rest of the functions I wanted to plot). This at least gave the graph a controllable scale, and then I adjusted the other functions to be within the box created by my first function.Sat, 22 Oct 2011 00:35:43 +0200https://ask.sagemath.org/question/7575/limiting-the-display-range-of-a-3d-plot/?answer=12795#post-id-12795