I have a plot with y-axis values that are rounded to two decimals by tikz. The change in the values occurs in the 3rd and 4th decimal.
Because of the rounding constant values are shown on the y-axis:
The MWE is shown below. I've tried setting the ytick
property to include the desired values, but this didn't solve the problem.
\documentclass{book}
\usepackage{amsmath}
\usepackage{tikz} % needed to import .tikz graphics
\usepackage{pgfplots} % needed to import .tikz graphics
\begin{document}
Text and image:
\begin{tikzpicture}
\begin{axis}[%
width=0.8\textwidth,
height=0.3\textheight,
scale only axis,
xmin=4000,
xmax=5000,
xtick={4000, 4200, 4400, 4600, 4800, 5000},
xlabel={iteration},
xmajorgrids,
ymin=0.4615,
ymax=0.4645,
ytick={0.4615, 0.4625, 0.4635, 0.4645},
ylabel={$\text{C}_\text{L}\text{ [-]}$},
ymajorgrids,
axis x line*=bottom,
axis y line*=left
]
\addplot [color=blue,solid,line width=1.5pt,forget plot]
table[row sep=crcr]{
3997 0.463684 \\
};
\end{axis}
\end{tikzpicture}%
\end{document}
How can I force tikz to display the exact y-axis values as set in the ytick
property?