Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm currently having trouble scaling TiKZ figures in LaTeX and wondering if anyone can help figure out what was going on, or suggest a smarter way to do things.

I'm currently creating plots in MATLAB 2012a and then saving these as .tikz files using the matlab2tikz package. After I have created the .tikz file (i.e. test.tikz), I use the following code to include it in my TeX document.

\begin{figure}
    \centering
    \newlength\fheight 
    \newlength\fwidth 
    \setlength\fheight{3cm} 
    \setlength\fwidth{3cm}
    \input{test.tikz}
    \caption{testing}
    \label{fig:test}
\end{figure}

Although I am able to include the picture, I can't seem to rescale it. In particular changing the fheight and fwidth from {3cm} to another figure does not seem to make any difference.

I'm also a lost in terms of finding the appropriate documentation for this approach to including figures in TeX files. Should I be checking out pgfplots or tikz? And should I be using the \input command or the \begin{tikzpicture} syntax.

share|improve this question
1  
For future reference, what would have been useful here would have been to see an example .tikz file. Well done for finding the solution yourself and for posting it here for anyone else stuck with this. –  Loop Space Apr 23 '12 at 7:03

1 Answer 1

up vote 6 down vote accepted

Just found out the answer to my problem :)

I was creating the figures in MATLAB using the code:

matlab2tikz( 'test.tikz')

I should have been creating them using the code:

matlab2tikz( 'test.tikz', 'height', '\fheight', 'width', '\fwidth' )
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.