1 | initial version |
Suppose you plot the sine function in Sage:
plot(sin(x), (x, 0, 2*pi))
and you want to save the picture. First, call the plot something:
plt = plot(sin(x), (x, 0, 2*pi))
And now save it as a pdf:
plt.save("MyPic.pdf")
The tex engine you use will determine how you save your picture. Many people use pdflatex as the engine, in which case the pdf format is fine. If you are using a regular latex engine then eps, rather than pdf, is expected. The different options, and the process of including the picture using the graphicx package are covered in the LaTeX Wikibooks here. The sagetex package provides another way of getting your image in without saving. It lets you run Sage code when you use LaTeX--see the documentation on how to use it. But you need both LaTeX and Sage on your computer. Unless you're using Sagemath Cloud, getting Sage and LaTeX set up to communicate on your PC can be a hassle.