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.Mon, 16 Nov 2015 10:57:47 -0600Boundaries for parametric_plot3d?http://ask.sagemath.org/question/30757/boundaries-for-parametric_plot3d/Is it possible to specify the bounding box of the output of a call to parametric_plot3d?
I am trying to produce animations of Frenet frames. The following code 'works' more or less, but in each frame sage changes the bounding box slightly, producing less than ideal results. If I have to resort to plotting some kind of bounding object with opacity set to 0, then so be it, but I am hoping for a more elegant solution.
t = var('t')
x(t) = (cos(3*t)+2)*cos(2*t)
y(t) = (cos(3*t)+2)*sin(2*t)
z(t) = -sin(3*t)
gamma = vector([x,y,z])
def length(v):
return sqrt(v[0]^2+v[1]^2+v[2]^2)
a = 0
b = 2*pi
P = parametric_plot3d(gamma(t),(t,a,b),frame=False)
T = gamma.diff(t)/length(gamma.diff(t))
N = T.diff(t)/length(T.diff(t))
B = T.cross_product(N)
def frame(t):
return P + arrow(gamma(t),gamma(t)+T(t),color='green',frame=False) + arrow(gamma(t),gamma(t)+N(t),color='red',frame=False) + arrow(gamma(t),gamma(t)+B(t),color='purple',frame=False)
num_frames = 10
frenet_movie = animate([frame(tt) for tt in srange(a,b,(b-a)/num_frames)])
frenet_movie.show()
(You can up num_frames if you want a smoother movie, though these take a while to render. The length function is defined because the `normalized()` method was producing lots of strange errors, namely with sage claiming it could not produce numerical approximations of the vectors involved....)Kyle OrmsbyMon, 16 Nov 2015 10:57:47 -0600http://ask.sagemath.org/question/30757/Plot boxes have jumpy xy ranges in log scalehttp://ask.sagemath.org/question/26637/plot-boxes-have-jumpy-xy-ranges-in-log-scale/Note: this is an attempt to concisely rephrase the issue at
[ask-sage question 26623](http://ask.sagemath.org/question/26623/modifying-xmin-value-and-frame-of-a-plot/).
Plotting in log scale, the bounding box doesn't adjust well to xmin, xmax, ymin, ymax.
It seems that plot bounding boxes are set with increments not adapted to log scale.
The following example illustrates this jumpiness in certain ranges of values.
opt = { 'ymin': 1, 'ymax': 25, 'scale': ('loglog', 10), 'frame': True }
def p(a): return plot(x, xmin=a, xmax=25, **opt)
for a in (1.2, 2, 3, 4): p(a).show() # poor xmin for bbox
for a in (4.5, 7, 10, 14): p(a).show() # poor xmax for bbox
for a in (12, 14, 20, 23): p(a).show() # poor xmin and xmax
slelievreFri, 24 Apr 2015 07:36:38 -0500http://ask.sagemath.org/question/26637/