Embedding Sage plots in PDF file using Sagetex

Here is the code to do this: (embedplot.tex)

\title{Embedding graphs plotted by SAGE in \LaTeX}
 \author{Priyanka Kapoor}


Using Sage\TeX, one can use Sage to compute things and put them into
your \LaTeX{} document. Following is the example showing this.

Here's some Sage code:

    f(x) = exp(x) * sin(2*x)


Here's a plot of $f$ from $-1$ to $1$:

\sageplot{plot(f, -1, 1,figsize=[3,2])}


Run the file using commands:

$ latex embedplot.tex
$sage embedplot.sagetex.sage
$pdflatex embedplot.tex
$evince embedplot.pdf

If you want to change the plot, just change f(x) and you will get a new plot.


About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s