\documentclass{article}
\usepackage{sagetex}
\usepackage{tikz}
\usepackage{tkz-berge}

\begin{document}

\title{Pretty pictures}
\maketitle

$\sage{2^32 + 1}$

Look mom, a plot of a sine curve:

\sageplot[angle=45, width=.5\textwidth]{plot(sin(2*x + 1), (x, 0, 2*pi))}

That was pretty cool. You just need to give \texttt{sageplot} something that it can call ``save'' on:

\begin{sageblock}
foo = plot(sin)
bar = circle((1/2, 3/4), 2, color='red')
\end{sageblock}

\sageplot{foo + bar}

Add ``aspect\_ratio=1'' to the circle command to fix the aspect ratio or do ``\verb|bar.set_aspect_ratio(1)|''.

Graphs:

\begin{sageblock}
  g = graphs.PetersenGraph()
\end{sageblock}

Somewhat confusingly, you just use \verb|\sage| and not \verb|\sageplot|:

\sage{g}

% get tkz-* stuff

3D plots always get saved in PNG format via Tachyon:

\begin{sagesilent}
  x, y = var('x y')
\end{sagesilent}

\sageplot[scale=.5]{plot3d(sin(pi*(x^2+y^2))/2,(x,-1,1),(y,-1,1))}




\end{document}