Im trying to include a colorbar, where I encounter some strange behaviour.
The first Colorbar works:
\documentclass{article}
\usepackage{tikzscale,pgfplots}
\pgfplotsset{compat=1.13}
\newcommand\figurescale{1}
\newlength\figH
\newlength\figW
\begin{document}
\centering
\setlength{\figH}{0.5\textheight}
\setlength{\figW}{0.9\textwidth}
\begin{tikzpicture}
\begin{axis}[
width=\figW,
height=0.333\figH,
at={(0\figW,0.002\figH)},
hide axis,
scale only axis,
colorbar sampled,
colormap/jet,
colorbar style={
samples=100,
point meta min=295.1111,
point meta max=295.5111,
scaled y ticks = false,
ytick={295.1111,295.5111},
yticklabel style={/pgf/number format/.cd,precision=5},
}
]
\end{axis}
\end{tikzpicture}
\end{document}
but changing the point meta max
from 295.5111
to 295.2111
and corresponding the ytick
as
\documentclass{article}
\usepackage{tikzscale,pgfplots}
\pgfplotsset{compat=1.13}
\newcommand\figurescale{1}
\newlength\figH
\newlength\figW
\begin{document}
\centering
\setlength{\figH}{0.5\textheight}
\setlength{\figW}{0.9\textwidth}
\begin{tikzpicture}
\begin{axis}[
width=\figW,
height=0.333\figH,
at={(0\figW,0.002\figH)},
hide axis,
scale only axis,
colorbar sampled,
colormap/jet,
colorbar style={
samples=100,
point meta min=295.1111,
point meta max=295.2111,
scaled y ticks = false,
ytick={295.1111,295.2111},
yticklabel style={/pgf/number format/.cd,precision=5},
}
]
\end{axis}
\end{tikzpicture}
\end{document}
leads to the error
Package pgfplots Error: the arguments of [mesh/rows=2,mesh/cols=75] assume 150 points, but I actually got N = 192 points! The data matrix appears to be incomplete or overcomplete!? [Use mesh/check=false to disable this message
Turning mesh/check=false
does not help (it results in a corrupted Colorbar).
Update
I could get the Interval a bit smaller with this:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
hide axis,
scale only axis,
height=0pt,
width=0pt,
colorbar,
colormap/jet,
point meta min=295.1111,
point meta max=295.1121,
colorbar style={
height=10cm,
ytick={295.1111,295.1121},
yticklabel style={/pgf/number format/.cd,fixed,precision=9},
}]
\addplot [draw=none] coordinates {(0,0)};
\end{axis}
\end{tikzpicture}
\end{document}
But changing point meta max from 295.1121 to 295.1112
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
hide axis,
scale only axis,
height=0pt,
width=0pt,
colorbar,
colormap/jet,
point meta min=295.1111,
point meta max=295.1112,
colorbar style={
height=10cm,
ytick={295.1111,295.1112},
yticklabel style={/pgf/number format/.cd,fixed,precision=9},
}]
\addplot [draw=none] coordinates {(0,0)};
\end{axis}
\end{tikzpicture}
\end{document}
gets the
Dimension too large
error. Is it possible to further decrease the displayed interval of the Colorbar? Is there a domain feature like in
pgfplots-error-dimension-too-large available for the colorbar?
I would like to change the meta max to about 295.11111112.
Update 2
Lualatex does not help here, it results in a corrupted colorbar:
Best Answer
I found a solution to it. I just created a colorbar with a "standard" range from 0 to 1 and replaced the yticklabels with the correct labels. The final result looks like this