Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{standalone}
- usepackage{pgfplots}
- begin{document}
- begin{tikzpicture}
- begin{axis}[colorbar, colormap={}{ gray(0cm)=(1); gray(1cm)=(0);}]
- addplot[mesh,thick] {x^2};
- end{axis}
- end{tikzpicture}
- begin{tikzpicture}
- begin{axis}[colorbar, colormap={}{ gray(0cm)=(0); gray(1cm)=(1);}]
- addplot[mesh,thick] {x^2};
- end{axis}
- end{tikzpicture}
- end{document}
- documentclass{standalone}
- usepackage{pgfplots}
- usepgfplotslibrary{colormaps}
- begin{document}
- pgfplotsset{
- %colormap={X}{ gray(0cm)=(1); gray(1cm)=(0);},
- colormap/winter,
- }
- begin{tikzpicture}
- begin{axis}[colorbar]
- addplot[mesh,thick] {x^2};
- end{axis}
- end{tikzpicture}
- begin{tikzpicture}
- begin{axis}[colorbar,
- colormap={reverse winter}{
- indices of colormap={
- pgfplotscolormaplastindexof{winter},...,0 of winter}
- },
- ]
- addplot[mesh,thick] {x^2};
- end{axis}
- end{tikzpicture}
- end{document}
- documentclass{standalone}
- usepackage{pgfplots}
- usepgfplotslibrary{colormaps}
- makeatletter
- defcustomrevertcolormap#1{%
- pgfplotsarraycopy{pgfpl@cm@#1}to{custom@COPY}%
- c@pgf@counta=0
- c@pgf@countb=pgfplotsarraysizeof{custom@COPY}relax
- c@pgf@countd=c@pgf@countb
- advancec@pgf@countd by-1 %
- pgfutil@loop
- ifnumc@pgf@counta<c@pgf@countb
- pgfplotsarrayselect{c@pgf@counta}of{custom@COPY}topgfplots@loc@TMPa
- pgfplotsarrayletentryc@pgf@countdof{pgfpl@cm@#1}=pgfplots@loc@TMPa
- advancec@pgf@counta by1 %
- advancec@pgf@countd by-1 %
- pgfutil@repeat
- %pgfplots@colormap@showdebuginfofor{#1}%
- }%
- makeatother
- begin{document}
- pgfplotsset{
- %colormap={X}{ gray(0cm)=(1); gray(1cm)=(0);},
- colormap/winter,
- }
- begin{tikzpicture}
- begin{axis}[colorbar]
- addplot[mesh,thick] {x^2};
- end{axis}
- end{tikzpicture}
- begin{tikzpicture}
- %customrevertcolormap{X}
- %customrevertcolormap{jet}
- customrevertcolormap{winter}
- begin{axis}[colorbar]
- addplot[mesh,thick] {x^2};
- end{axis}
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement