1

Using matlab2tikz version 1.0.0 the MATLAB code

scatter3([0 1],[0 1],[0 1]);
hold on
quiver3(0,0,0,1,1,1,0);
matlab2tikz('test.tex');

produces

MATLAB plot

and the tex file test.tex. Plotting this file without changing anything in tex via

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\input{test}
\end{document}

produces

Tex plot

because matlab2tikz converted the arrow in the matlab plot to

\addplot3 [arrow1] coordinates{(0,0,0) (0.9,0.9,0.9)};

In this case scaling the arrow by 1/0.9 in the MATLAB code or correcting the coordinates manually in tex helps. But often scaling the arrows before exporting the plot doesn't even help, it still gets plotted with the same wrong length. The scaling factor always seems to differ from plot to plot.

What can I do?

1

This is a bug in matlab2tikz version 1.0.0 by this answer here. Using the current development version solves the problem.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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