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, 27 Apr 2018 11:18:47 -0500Orienting and Saving 3D Plotshttp://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 -0500http://ask.sagemath.org/question/42190/Rotate a 2d plothttp://ask.sagemath.org/question/35611/rotate-a-2d-plot/I have a 2d plot with multiple arrows, lines etc. and I would like to rotate the entire thing. Here's a simple example without rotation. The real example has more objects on it so I'd rather rotate the entire plot than each individual object.
O = vector((0, 0))
Tp = vector((1, 0))
Np = vector((0, 1))
p = plot([])
p += arrow2d(O, Tp, color="blue")
p += arrow2d(O, Np, color="blue")
p.show(axes=False, aspect_ratio=1)
How can I go about rotating the entire plot by a fixed angle? I have only been able to find information about rotations for 3d plots.Paul BryanWed, 16 Nov 2016 07:35:41 -0600http://ask.sagemath.org/question/35611/How to rotate an external image in sagehttp://ask.sagemath.org/question/32181/how-to-rotate-an-external-image-in-sage/ I want to rotate an external image in sage. I know how to rotate a plot created on sage and how to load an external image and view it later, but i cant use de function rotate on an external image. When I try to rotate the image with "rotate" sage says that the object doesnt have such attribute. Does someone know how to do it?lauwiWed, 13 Jan 2016 04:36:47 -0600http://ask.sagemath.org/question/32181/