4

I'm using matlab2tikz to generate the tikz code for my figures. When compiling the document with the figure code as below, I get an ovelapping with the axis label y and z.

Here is what I've got:

enter image description here

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgfplots}

\newlength\figureheight
\newlength\figurewidth

\begin{document}

\begin{figure}
\setlength\figureheight{6cm} 
\setlength\figurewidth{6cm}
\begin{tikzpicture}

\begin{axis}[%
view={45}{-30},
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=0, xmax=10,
xlabel={x},
ymin=0, ymax=10,
ylabel={y},
zmin=0, zmax=10,
zlabel={z},
axis lines*=left]
\addplot3 [
color=red,
only marks,
mark=o,
mark options={solid}
]
coordinates{
(1,1,1)(2,2,2)(3,3,3)(4,4,4)(5,5,5)(6,6,6)(7,7,7)(8,8,8)(9,9,9)(10,10,10) 
};

\end{axis}
\end{tikzpicture}%

\end{figure}

\end{document}

Is there exist a way to solve it?

Carlos
  • 41
  • It is my first post here, it seems to be a great community, I've been reading some other post and found them really interesting. – Carlos Oct 23 '12 at 22:28
  • 1
    \figurewidth and \figureheight throw errors. Please add a minimal working example (MWE). If I remove those two lines, the plot is compilable. Although the pgfplots' style is very different to your image. – Qrrbrbirlbel Oct 23 '12 at 23:24
  • I forgot to put them, now I added the MWE. – Carlos Oct 24 '12 at 00:05
  • 1
    @Carlos Include the name of the user you are answering to (as I did now) so that they will be notified, that you have left them a message. If I compile your MWE, all is fine. Is your TeX distribution updated? What version of TikZ/pgfplots do you use? Hint: \listfiles – Qrrbrbirlbel Oct 24 '12 at 00:47
  • @Qrrbrbirlbel I'm using Ubuntu and I just realised that Ubuntu came with an outdated Latex version, the \listfiles shows me that the pdfplots package is from 2010, I'm going to update it now. – Carlos Oct 24 '12 at 01:09
  • If updating resolves your issues, please say so, so that this question can be closed. – Qrrbrbirlbel Oct 24 '12 at 02:10
  • 1
    Finally I updated my Latex version, it resolved my problem, now the plot is like the posted by @Qrrbrbirlbel. – Carlos Oct 24 '12 at 11:47

0 Answers0