1

I'm wondering if I can change the number format of the colorbar for a 3D plot. Unfortunately I don't find any answers in the pgfplots manual. Do you have an idea?

\begin{tikzpicture}
\begin{axis}[
   /pgf/number format/.cd,
        use comma,
        1000 sep={},
        colorbar,
         colorbar style={
        xticklabel={Leistungsbilanz},
    },
            xlabel={$\vartheta_i$ [°C]},
    ylabel={$\dot{W}_R$ [W]},
    zlabel={Leistungsbilanz [W]},
]
    \addplot3+ [mark=none,
    domain=20:180,
    domain y = 0:5500,
    samples = 20,
    samples y = 8,
    surf,
    shader = interp] {y-1600-1.1*(x-20)};

\end{axis}
\end{tikzpicture}
2
  • The colorbar is, concerning the number format, no different from axes (to the best of my knowledge), so you can use the manual describing the latter.
    – user255043
    Nov 6, 2021 at 21:35
  • thanks, but that doesn't seem to work. I have edited the original post and added th example
    – maximus
    Nov 7, 2021 at 16:50

1 Answer 1

0
\documentclass[tikz, border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
tick label style={
  /pgf/number format/.cd, use comma, 1000 sep={},
},
colorbar,
xlabel={$\vartheta_i$ [°C]},
ylabel={$\dot{W}_R$ [W]},
zlabel={Leistungsbilanz [W]},
]
\addplot3+ [mark=none,
domain=20:180, domain y = 0:5500,
samples = 20, samples y = 8,
surf, shader = interp,
] {y-1600-1.1*(x-20)};
\end{axis}
\end{tikzpicture}
\end{document}

3D surface plot with colorbar

1
  • alrigth, thanks!
    – maximus
    Nov 7, 2021 at 19:12

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.