Layout of Sagetex in Tex (using Kile)

If you have something like:

\begin{sagesilent}
G=Graphics()
H=Graphics()
var('x')
G+=plot(cos(x),(x,0,pi))
H+= text("$\cos(x)$", (1, 1), fontsize=16, color='black')
\end{sagesilent}
$\sageplot{G+H}$


into a tex file, how can you place it on the left or on the right, and make it smaller, or even show it vertically? Note: the whole thing is showing correctly, but just too big in the middle of the page. I need general advise in how to deal with sagemath plots like this (using Kile).

-

You can center the plot with \begin{center} ... \end{center} and control the size with the scale option to \sageplot as this working example shows:

    \documentclass{article}
\usepackage{sagetex}
\begin{document}
\pagestyle{empty}
\begin{sagesilent}
G=plot(cos(x),(x,0,pi))
H= text("$\cos(x)$", (1, 1), fontsize=16, color='black')
\end{sagesilent}
\begin{center} \sageplot[scale=.5]{G+H} \end{center}
\end{document}


-