3

I have sort of a strange problem. I produced a 3x2 plot array in Matlab, and removed all of the y-axis tick labels. The relevant code (for the problematic plot) is below

\begin{tikzpicture}

\begin{axis}[%
width=\figurewidth,
height=\figureheight,
scale only axis,
scaled y ticks = true,
xmin=0,
xmax=50,
xtick={ 0, 10, 20, 30, 40, 50},
xmajorgrids,
ymin=0,
ymax=15e6,
ytick={0,5e6,10e6,15e6},
yticklabels={,,,},
name=plot1,
at=(plot3.above north west),
anchor=below south west
]
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
1 102360.942462359\\
2 85927.6966525591\\
3 2845564.93058913\\
};
\end{axis}
\end{tikzpicture}%

The other plots are similar, but without this problem. The resulting figure is

enter image description here

There's that orphaned tick label in the top left corner, and I don't know why it's there or how to get rid of it. Any ideas?

3

To remove the axis multiplier, set scaled y ticks=false. To keep the tick marks but not print any labels, set yticklabels={}:

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}

\begin{axis}[%
scale only axis,
scaled y ticks = true,
xmin=0,
xmax=50,
xtick={ 0, 10, 20, 30, 40, 50},
xmajorgrids,
ymin=0,
ymax=15e6,
ytick={0,5e6,10e6,15e6},
scaled y ticks=false,
yticklabel=\relax,
anchor=below south west
]
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
1 102360.942462359\\
2 85927.6966525591\\
3 2845564.93058913\\
};
\end{axis}
\end{tikzpicture}%
\end{document}

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.