I am trying to plot a matlab figure in latex file. so i use this matlab2tikz function.
It works really well, until I try to add some customised text on the figure before converting it to tikz file, and when I try to build my latex file, it say error something like
Package pgfplots Error: the arguments of [mesh/rows=2,mesh/cols=0] assume 0 p
oints, but I got actually N = 1 points! The data matrix appears to be incomplete
The problem is gone when I remove the text from the matlab file.
Can anyone help me?
I can't provide the real data here since it's too long, but I can give you an example.
Imagine I am plotting this
syms x
ezplot(sin(6*x))
Then, once it is plotted in the matlab, I go to Insert>Text Box and add some text on the figure.
Then, I will run this code
matlab2tikz('test.tikz', 'height', '\figureheight', 'width', '\figurewidth')
However, when I put this code in latex
\begin{figure} [H]
\centering
\input{Chapter4/Figs/test.tikz}
\caption[Surface force calibration]{Surface force calibration with small loads (100g, 200g and 300g)}
\label{fig:irfan}
\end{figure}
it is saying the error.
matlab2tikz:Warning: Don't know class 'scribe.textbox'. Default handling.Comparing the output of the function with and without a text box, it seems that the default handling goes wrong. For example, I don't see why a textbox would be drawn as a three dimensional plot with\addplot3. The text of the box is not included in the.tikzfile, either. I suggest checking https://github.com/nschloe/matlab2tikz/issues and filing a feature request / bug report if the issue has not been reported yet. – mvkorpel Aug 08 '14 at 13:05pgfplotserror message is the same as yours. The message continues:or overcomplete!? [Use mesh/check=false to disable this message].– mvkorpel Aug 08 '14 at 13:17matlab2tikzauthor on GitHub about this specific problem. – Mike Renfro Aug 12 '14 at 12:18.tikzfile produced bymatlab2tikzand manually adding a text label. See Annotating a pgfplots graph – mvkorpel Aug 12 '14 at 12:35