Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to zoom in on saved plot?

Hello all!

I'm trying to make some animations for a class I'm teaching, but, while I've been able to have them animate the way I want, when I save the animation the objects are really small compared to the size of the file. For example, this is what one frame of the output looks like: imgur.com/a/BURrSXI; but I'd rather have it look like this: imgur.com/a/l3TVDGK. Is there any way I can control the output of Sage so that the objects take up more of the animation/image? Thank you!

Edit: If it helps, I am making my animations with parametric_plot3d and Sphere's. I have a graphics object G that I am adding all of my spheres and parametric plots to. Then, I'm saving that graphics object via the .save method.

num_frames_graph = 100 
frames_list_graph = [0]*10 
frames_list_graph.extend(list(range(0,num_frames_graph))) 
frames_list_graph.extend([num_frames_graph for i in range(0,15)]) 
frames_list_graph.extend(frames_list_graph[::-1]) 
graph_frames = [graph_projection(RDF(time / num_frames_graph)) for time in frames_list_graph]


os.system("mkdir graphFrames")
for i,frame in enumerate(graph_frames):
        frame.save(filename="graphFrames/graph%04d.png"%i, 
            figsize=[12,8], 
            dpi = 1000, 
            xmin = -2.1, 
            xmax = 2.1,  
            ymin = -2.1, 
            ymax = 2.1, 
            zmin=-2.1, 
            zmax=2.1, 
            transparent=True, 
            aspect_ratio=1
        )
os.system('cd graphFrames; convert -delay %s -loop %s *.png "graph.gif"'%(float(100/60),int(0)))

Is the general method of how I'm constructing my animations