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, 06 Aug 2015 09:36:20 +0200How to scale threejs graphs?https://ask.sagemath.org/question/24228/how-to-scale-threejs-graphs/ Hi,
jmol works nicely in scaling 3d graphs in sagecell, however threejs does not. Even manual scaling using aspect_ratio does not seem to work; aspect_ratio is apparently ignored.
Example:
%var x,y
g=plot3d(x^3*y^3, (x,-2,2),(y,-2,2),aspect_ratio=[1.0,1.0,.001])
threejs(g)
Is there another way to scale graphs with threejs?
Best
IngoIngo DahnSun, 21 Sep 2014 13:23:12 +0200https://ask.sagemath.org/question/24228/polygon plot does not scale wellhttps://ask.sagemath.org/question/28763/polygon-plot-does-not-scale-well/Hi,
I'm trying to plot several polygons in one plot (with plot1+plot2+...). Strangly, for very different side length, the plot becomes more of a line instead of a rectangle. I tried the following code on SMC and locally:
hp=0.019
qscale=hp
polygon2d([[0.5-0.5,hp/2-qscale*0.05],[0.5+0.5,hp/2-qscale*0.05],[0.5+0.5,hp/2+qscale*0.05],[0.5-0.5,hp/2+qscale*0.05]], fill=False, thickness=1, color='blue',ticks=[None,0.0001])
I'd like to upload a picture but you need 60 karma points for that and since my old account belonging to google identity is lost I hope you can recreate the problem. Thanks in advance.
Update:
I wrote a minimal example which shows that the problem appears when the side length are not of the same order of magnitude
for i in [0.1,1,10,100]:
show(polygon2d([[0,0],[0,i],[1,i],[1,0]], fill=false))kafusslThu, 06 Aug 2015 09:36:20 +0200https://ask.sagemath.org/question/28763/Preserving aspect ratio in animationhttps://ask.sagemath.org/question/26390/preserving-aspect-ratio-in-animation/I'm trying to animate a series of increasing, nested tori. I'm testing the code for the first one, but the aspect ratio isn't behaving, and axes are showing up. I've tried messing with figsize, to no avail. Suggestions?
u,v = var('u,v')
def is_even(n):
return n%2 == 0
def c(n):
return 2/3*(4^(n+1)-4)
def torus(n,u,v):
if is_even(n):
return [(2*4**n + 4**n*cos(u))*cos(v), (2*4**n + 4**n*cos(u))*sin(v) + c(n), 4**n*sin(u)]
else:
return [4**n*sin(u), (2*4**n + 4**n*cos(u))*sin(v) + c(n), (2*4**n + 4**n*cos(u))*cos(v)]
T = []
for i in range(10):
T.append(parametric_plot3d(torus(0,u,v), (u,0,(i+1)*2*pi/9), (v,0,(i+1)*2*pi/9), axes="false"))
a = animate(T)
a.show() Jeff FordMon, 30 Mar 2015 23:34:56 +0200https://ask.sagemath.org/question/26390/