I am using Octave for all my calculations and plotting. By telling Octave
graphics_toolkit gnuplot
I can create a *.tex-document by
print -dtikz filename.tex
Which I can then use by
\input{filename}
In combination with
\usepackage{gnuplot-lua-tikz}
\usepackage{graphicx}
\usepackage{pgfsys}
\usepackage{keyval}
\usepackage{xcolor}
\usepackage{tikz}
Only problem is the size of the graph. During my long path to the above findings, I remember an error message saying that gnuplot uses a standard graph size of 560 by 420 pt. In LaTeX, I usually use something like
width = 0.9\textwidth
for non-*.tex graphs and I would like my plots to be approximately that large, because I would not like to fumble around with scaling factors or other parameters. That can sometimes mess up the relative positions of the single graphics items.
How do I change the plot size that Gnuplot creates from Octave?
Best Answer
When using
\input{...}
as a way of including figures made byOctave
orgnuplot
you may rescale the image using\resizebox{x}{y}{\input{...}}
, wherex
andy
are the required image dimensions in whatever units that you wish. The usage you would like to have requires keeping proportions constant, which would mean typingwhere the
!
fills the missing height to keep the overall proportions constant. This worked throughout myLaTeX
-aware life. However, this does not necessarily look nice, because the image will not be of appropriate scale: text might be minute, figure illegible, etc. If you wish to instead create the figure to have correct size directly inOctave
, you should use thepapersize
property:The units used are points. Alternatively, you may use the
-Sx,y
switch of theprint
command; the two approaches are equivalent, but I think changing the figure properties is more rewarding and definitely more general, hence powerful.