How to save a plot from notebook?
Is it possible to export a plot, preferable in a vector format from a notebook?
Is it possible to export a plot, preferable in a vector format from a notebook?
If p
is any plot object, then you can use the save
method to save it to a file. The type of file written will be based on the extension of filename given. For example,
p = plot(x^2, -5, 5)
p.save('filename.svg')
will save an SVG. Since the directory in which to save the image was not specified, it will do it in a special directory reserved for the input cell. The notebook will automatically detect that this file is present and then either display it or display a link from which you can download it. You can also use .eps
or .ps
for PostScript files which are also vector graphics.
a = [(x,x^2) for x in xrange(100)]; img = list_plot(a); img.save("filename.svg");
I'm sure there are more elegant idioms and display options, but that will indeed save a scalable vector graphic.
Asked: 2010-08-21 11:56:18 -0600
Seen: 2,241 times
Last updated: Aug 21 '10
Why does graph plotting crop so aggressively, and what is a work-around?
Save plot in SVG with plain text strings
Plotting in sage 4.8 defaults to firefox, WHY?
Save plots into a multi-page pdf?
open a plot window from sage-console
Graph edge label: formatting possibilities
convert a symbolic var into a numeric var
Is there a way to draw a graph using a specific embedding?
How do I plot a real function whose computation involves complex intermediate results?