From db20f9c5d6e25591ea4a6b9072c436d9189e0bd7 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Sat, 23 Dec 2023 20:15:02 +0100 Subject: [PATCH] Minor changes to colorscheme example --- examples/colorschemes.tex | 113 +++++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 49 deletions(-) diff --git a/examples/colorschemes.tex b/examples/colorschemes.tex index af2396c..1f4310a 100644 --- a/examples/colorschemes.tex +++ b/examples/colorschemes.tex @@ -18,7 +18,6 @@ \input{common.tex} -\pgfplotsset{colorscheme/cel} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -26,61 +25,77 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\title{Colorschemes} +\author{} +\date{} + + \begin{document} +\maketitle + +\foreach \x in {cel, rocket, viridis, mako, cividis, matplotlib}{ + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Set colorscheme -\foreach \x in {cel, rocket, viridis, mako, cividis}{ \pgfplotsset{colorscheme/\x} - \colorbox{gray!30}{\texttt{colorscheme/\x}} - \begin{figure}[H] - \centering + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Preview colorscheme - \tikzstyle{colornode} = [draw, inner sep=0pt, minimum width=1cm, minimum height=0.5cm] - \pgfplotsset{scaled y ticks=false} + \noindent\begin{minipage}{\textwidth} + \colorbox{gray!30}{\texttt{colorscheme/\x}} + \begin{figure}[H] + \centering - \begin{subfigure}[c]{0.45\textwidth} - \begin{tikzpicture} - \begin{axis}[ - domain=0:10, - view={0}{90}, - yticklabel=\empty,xticklabel=\empty, - width=\textwidth, - height=0.75\textwidth, - ] - \addplot3+[surf] - {x + y}; - \end{axis} - \end{tikzpicture} - \end{subfigure}% - \begin{subfigure}[c]{0.45\textwidth} - \begin{tikzpicture} - \begin{axis}[ - domain=0:10, - ymin=-1e4,ymax=1, - legend pos=south west, - yticklabel=\empty,xticklabel=\empty, - width=\textwidth, - height=0.75\textwidth, - ] - \foreach \i in {1,2,4,8}{ - \addplot+ [mark=none, line width=1pt] - {-\i*exp(x)}; - %\expandafter\addlegendentry\expandafter{$e^{-\text{\i} x}$} - \addlegendentryexpanded{$e^{-\i x}$} - } - \end{axis} - \end{tikzpicture} - \end{subfigure}% - \begin{subfigure}[c]{0.1\textwidth} - \begin{tikzpicture} - \node[colornode, fill=scol3] (color3) {}; - \node[colornode, fill=scol2, above=1mm of color3] (color2) {}; - \node[colornode, fill=scol1, above=1mm of color2] (color1) {}; - \node[colornode, fill=scol0, above=1mm of color1] (color0) {}; - \end{tikzpicture} - \end{subfigure}% - \end{figure} + \tikzstyle{colornode} = [draw, inner sep=0pt, minimum width=1cm, minimum height=0.5cm] + \pgfplotsset{scaled y ticks=false} + + \begin{subfigure}[c]{0.45\textwidth} + \begin{tikzpicture} + \begin{axis}[ + domain=0:10, + view={0}{90}, + yticklabel=\empty,xticklabel=\empty, + width=\textwidth, + height=0.75\textwidth, + ] + \addplot3+[surf] + {x + y}; + \end{axis} + \end{tikzpicture} + \end{subfigure}% + \begin{subfigure}[c]{0.45\textwidth} + \begin{tikzpicture} + \begin{axis}[ + domain=0:10, + ymin=-1e4,ymax=1, + legend pos=south west, + yticklabel=\empty,xticklabel=\empty, + width=\textwidth, + height=0.75\textwidth, + ] + \foreach \i in {1,2,4,8}{ + \addplot+ [mark=none, line width=1pt] + {-\i*exp(x)}; + %\expandafter\addlegendentry\expandafter{$e^{-\text{\i} x}$} + \addlegendentryexpanded{$e^{-\i x}$} + } + \end{axis} + \end{tikzpicture} + \end{subfigure}% + \begin{subfigure}[c]{0.1\textwidth} + \begin{tikzpicture} + \node[colornode, fill=scol3] (color3) {}; + \node[colornode, fill=scol2, above=1mm of color3] (color2) {}; + \node[colornode, fill=scol1, above=1mm of color2] (color1) {}; + \node[colornode, fill=scol0, above=1mm of color1] (color0) {}; + \end{tikzpicture} + \end{subfigure}% + \end{figure} + \vspace{\parskip} + \end{minipage} }