Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

01 Sep '18, 14:31

cis's gravatar image

cis
9.6k104461491

pgfplots: Umgang mit der colormap - Erstellen einer colormap

[![alt text][1]][1] Wie kann ich eine `colormap` z.B. so einstellen, dass `0 = schwarz`, `1 = blau`, `2 = rot` bedeutet, vorzugsweise mit Farbnamen, also etwa `red`, nicht `rgb()` usw. Mit `\pgfplotscolormapdefinemappedcolor{#1}` greift man scheints auf die colormap zu, aber wie erstelle ich eine colormap zielführend? \documentclass[margin=5mm, tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{colormaps} \pgfplotsset{compat=1.12} \tikzset{Farbe/.style={/utils/exec={\pgfplotscolormapdefinemappedcolor{#1}}, draw=black, fill=mapped color} } \begin{document} \begin{tikzpicture} \begin{axis}[ % Geht nicht %colormap={test}{color(0cm)=(red); color(1cm)=(blue); color(2cm)=(red);} % Alles schwarz colormap={test}{color=(black) color=(red)}, % %colormap/hsv, hide axis,axis equal, xmin=-2.5, xmax=5, ymin=-.5, ymax=.5, ] \draw[Farbe=0, xshift=-2cm] (0,0) rectangle (1,1); \draw[Farbe=1] (0,0) rectangle (1,1); \draw[Farbe=2, xshift=2cm] (0,0) rectangle (1,1) node[right]{IST}; \draw[fill=black, xshift=-2cm, yshift=-2cm] (0,0) rectangle (1,1); \draw[fill=blue, yshift=-2cm] (0,0) rectangle (1,1); \draw[fill=red, xshift=2cm, yshift=-2cm] (0,0) rectangle (1,1) node[right]{SOLL}; \end{axis} \end{tikzpicture} \end{document} [1]: https://texwelt.de/wissen/upfiles/55555555_194.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

01 Sep '18, 14:28

cis's gravatar image

cis
9.6k104461491

pgfplots: Umgang mit der colormap

[![alt text][1]][1] Wie kann ich eine `colormap` z.B. so einstellen, dass `0 = schwarz`, `1 = blau`, `2 = rot` bedeutet, vorzugsweise mit Farbnamen, also etwa `red`, nicht `rgb()` usw. Mit `\pgfplotscolormapdefinemappedcolor{#1}` greift man scheints auf die colormap zu, aber wie erstelle ich eine colormap zielführend? \documentclass[margin=5mm, tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{colormaps} \pgfplotsset{compat=1.12} \tikzset{Farbe/.style={/utils/exec={\pgfplotscolormapdefinemappedcolor{#1}}, draw=black, fill=mapped color} } \begin{document} \begin{tikzpicture} \begin{axis}[ % Geht nicht %colormap={test}{color(0cm)=(red); color(1cm)=(blue); color(2cm)=(red);} % Alles schwarz colormap={test}{color=(black) color=(red)}, % %colormap/hsv, hide axis,axis equal, xmin=-2.5, xmax=5, ymin=-.5, ymax=.5, ] \draw[Farbe=0, xshift=-2cm] (0,0) rectangle (1,1); \draw[Farbe=1] (0,0) rectangle (1,1); \draw[Farbe=2, xshift=2cm] (0,0) rectangle (1,1) node[right]{IST}; \draw[fill=black, xshift=-2cm, yshift=-2cm] (0,0) rectangle (1,1); \draw[fill=blue, yshift=-2cm] (0,0) rectangle (1,1); \draw[fill=red, xshift=2cm, yshift=-2cm] (0,0) rectangle (1,1) node[right]{SOLL}; \end{axis} \end{tikzpicture} \end{document} [1]: https://texwelt.de/wissen/upfiles/55555555_194.png