ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 27 Apr 2018 11:18:47 -0500Orienting and Saving 3D Plotshttps://ask.sagemath.org/question/42190/orienting-and-saving-3d-plots/Hi !
I am very new to using Sage, I've started only a few weeks ago. I hope my inability to answer anyone's questions won't ruin my "karma" ! Anyway, here is my first question:
I've been experimenting with plotting 3D objects, so far. Right now, I am plotting simple cubes scattered in space. With great satisfaction, I've noticed I could initialize the point of view of my 3D plot by specifying:
orientation(0,0,0,0)
That initializes to X being horizontal, Y vertical, and Z orthogonal to the screen. Then, I specify:
G.rotate([1,0,0],pi/4).show(aspect_ratio=[1,1,1],frame=False)
and get a point of view I really like. My goal is to generate a bunch of .png files of my cubes from different points of view, and I was hoping to use this rotate() functionality with a [ for i in range(n)] type statement. Therefore, I'd really like SAGE to write a bunch of .png files without me generating images one by one and saving manually. So I tried using the save() function, like so:
G.rotate([1,0,0],pi/4).save("MyImage.png",aspect_ratio=[1,1,1],frame=False)
Here is my problem: when I use the save() function, my previous orientation(0,0,0,0) statement is completely overridden, and the resulting MyImage.png I get is rotated according to rotate([1,0,0],pi/4), but not from the intented X being horizontal, Y vertical, and Z orthogonal to the screen configuration, rather, from the default point of view show() gives me, if I do not specify orientation(0,0,0,0).
Why is it so, and how can I fix this ?
Thank you very much,
Turiel.TurielFri, 27 Apr 2018 11:18:47 -0500https://ask.sagemath.org/question/42190/