1

Please see this post for more background.

The problem is that tick mark labels explicitly specified by code of the form:

text(x(k),y(k),labs{k},'horizontalalignment',horizk,...
'verticalalignment',vertk, ...
'rotation',rotang(k), ...
'fontsize',gfontsize*scl(k), ...
'color',gcolor, ...
'tag','m_grid_xticklabel', ...
'fontname',gfontname);

in Matlab (matlab2tikz is run, .tex compiled with pdflatex) are not properly aligned (vertical only, as far as I can tell) when the 'camera view angle' is adjusted with say, view(45,45).

Here are the axis options from the .tex code:

\begin{axis}[%
width=\figurewidth,
height=\figureheight,
unbounded coords=jump,
clip=false,
view={45}{45},
scale only axis,
xmin=-0.000750572061953379,
xmax=0.000750572061953379,
xtick={-0.0005,0,0.0005},
xticklabels={{-1},{-0.5},{0},{0.5},{1}},
ymin=-0.000901759142452274,
ymax=0.000901887945571112,
ytick={-0.0005,0,0.0005},
yticklabels={{-1},{-0.5},{0},{0.5},{1}},
zmin=-1e+16,
zmax=0,
ztick={-1e+16,-9e+15,-8e+15,-7e+15,-6e+15,-5e+15,-4e+15,-3e+15,-2e+15,-1e+15,0},
hide axis,
axis x line*=bottom,
axis y line*=left,
axis z line*=left,
axis on top,
clip=false
]

as well as, the .tex code associated with the label.

\node[left, inner sep=0mm, rotate=359.980625982625, text=black]
at (axis cs:-0.000768608531802478,0.000872799628421937,0) { 39'};

I have also attached the compiled figure

enter image description here

4
  • Welcome at tex.sx! What you show here appears to be a defect/weakness in matlab2tikz. You should post the same question there. A correct solution would probably make use of xticklabel cs and near xticklabel anchors (and its friends), compare the pgfplots manual section "4.9 Axis Descriptions". If you want to repair the figure at hand and you want help here, I suggest to file a complete minimal example such that we can reproduce the figure. Feb 22, 2015 at 18:47
  • Once again, it always seem to work better to do normal tikz graphics AFTER \end{axis}. You can save \coordinates using (cs axis: x,y) inside the axis environment and use them later. Feb 22, 2015 at 20:01
  • You can post bug reports for matlab2tikz at github.com/matlab2tikz/matlab2tikz/issues Feb 22, 2015 at 21:22
  • 4
    I'm voting to close this question as off-topic because it appears to be about a bug in matlab2tikz. Mar 8, 2015 at 8:31

0

Browse other questions tagged .