Is it possible to get a logarthmic colorbar?
\documentclass{article}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[enlargelimits=0.2,colorbar]
\addplot[
scatter,mark=square*,only marks,
point meta=\thisrow{myvalue}
]
table {
x y myvalue
0.5 1 0.25
0.2 2 3
0.7 3 0.75
0.35 4 0.125
0.65 5 2
};
\end{axis}
\end{tikzpicture}
\end{document}
Solution?->
\documentclass{article}
\usepackage{tikz,pgfplots}
\begin{document}
\pgfmathdeclarefunction{lg10}{1}{ \pgfmathparse{ln(#1)/ln(10)}}
\begin{tikzpicture}
\begin{axis}[enlargelimits=0.2,colorbar, colorbar style={yticklabel=\pgfmathparse{10^\tick}\pgfmathprintnumber\pgfmathresult}]
\addplot[
scatter,mark=square*,only marks,
point meta=\thisrow{myvalue}
]
table {
x y myvalue
0.5 100 554
0.2 2000 3546546
0.7 3745 0.755
0.35 74 0.125
0.65 775 2555
};
\end{axis}
\end{tikzpicture}
\end{document}
This is the solution? is this logaritmic? Looks linear
\pgfmathdeclarefunction{lg10}{1}{ \pgfmathparse{ln(#1)/ln(10)}}and then set youraxisoptional argument to[enlargelimits=0.2,colorbar, colorbar style={yticklabel=\pgfmathparse{10^\tick}\pgfmathprintnumber\pgfmathresult}]– Steven B. Segletes Jul 11 '17 at 12:59\usepackage{tikz,pgfplots}
\begin{document} \pgfmathdeclarefunction{lg10}{1}{ \pgfmathparse{ln(#1)/ln(10)}} \begin{tikzpicture}
\begin{axis}[enlargelimits=0.2,colorbar, colorbar style={yticklabel=\pgfmathparse{10^\tick}\pgfmathprintnumber\pgfmathresult}]
\addplot[ scatter,mark=square*,only marks, point meta=\thisrow{myvalue} ] table { x y myvalue 0.5 100 554 0.2 2000 3546546 0.7 3745 0.755 0.35 74 0.125 0.65 775 2555 }; \end{axis} \end{tikzpicture}
\end{document}
– josef Jul 11 '17 at 13:16