How do I change the aspect ratio of the canvas of a gnuplot plot in LaTeX using the gnuplottex package?
The following changes the aspect ratio of the output but not the canvas size, thus leaving a margin above and below the graph.
\documentclass{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[miktex,cleanup]{gnuplottex} %miktex option for my editor
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\begin{figure}[htbp]
\centering
\begin{gnuplot}[terminal=cairolatex]
set size ratio 0.2
plot [0:2*pi] sin(x) with lines linewidth 2 title 'Sine'
\end{gnuplot}
\end{figure}
\end{document}



terminaloptionsparameter to set the canvas size:\begin{gnuplot}[terminal=cairolatex, terminaloptions={size 14cm, 4cm}]. But I don't know how to pass the\textwidthinto this parameter. – Christoph Sep 17 '13 at 09:24sizeis used to change the canvas. Unfortunately, there is no optioncropfor thegnuplottexpackage. So you may need to play around with the gnuplot margins e.g.set tmarginorset size(withoutratio) andset origin. – Christoph Sep 17 '13 at 10:02