Compare commits

...

2 Commits

Author SHA1 Message Date
177f481b7e Add matplotlib colorscheme 2023-12-23 20:16:05 +01:00
db20f9c5d6 Minor changes to colorscheme example 2023-12-23 20:15:06 +01:00
2 changed files with 120 additions and 76 deletions

View File

@ -23,7 +23,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Graphics & Plotting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Data Manipulation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -72,21 +72,17 @@
} }
} }
%
% Styles
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pgfplotsset{ % Graphics & Plotting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fancy marks/.style={ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO
}
}
% %
% Colors % Colors
% %
% KIT Colors
\definecolor{kit-green100}{rgb}{0,.59,.51} \definecolor{kit-green100}{rgb}{0,.59,.51}
\definecolor{kit-green70}{rgb}{.3,.71,.65} \definecolor{kit-green70}{rgb}{.3,.71,.65}
\definecolor{kit-green50}{rgb}{.50,.79,.75} \definecolor{kit-green50}{rgb}{.50,.79,.75}
@ -143,6 +139,19 @@
\colorlet{kit-cyanblue30}{KITcyanblue!30} \colorlet{kit-cyanblue30}{KITcyanblue!30}
\colorlet{kit-cyanblue15}{KITcyanblue!15} \colorlet{kit-cyanblue15}{KITcyanblue!15}
% Matplotlib Colors
\definecolor{Mpl1}{HTML}{1f77b4}
\definecolor{Mpl2}{HTML}{ff7f0e}
\definecolor{Mpl3}{HTML}{2ca02c}
\definecolor{Mpl4}{HTML}{d62728}
\definecolor{Mpl5}{HTML}{9467bd}
\definecolor{Mpl6}{HTML}{8c564b}
\definecolor{Mpl7}{HTML}{e377c2}
\definecolor{Mpl8}{HTML}{7f7f7f}
\definecolor{Mpl9}{HTML}{bcbd22}
\definecolor{Mpl10}{HTML}{17becf}
% %
% Color Schemes % Color Schemes
% %
@ -180,6 +189,11 @@
color=(kit-green70); color=(kit-green70);
color=(kit-yellow70!80!kit-orange70); color=(kit-yellow70!80!kit-orange70);
}, },
colormap={matplotlib}{
color=(blue!90!black);
color=(red!20!blue!20);
color=(red!90!black);
}
} }
% Define cycle lists % Define cycle lists
@ -199,8 +213,11 @@
\pgfplotscreateplotcyclelist{cel}{% \pgfplotscreateplotcyclelist{cel}{%
[samples of colormap={4} of cel]% [samples of colormap={4} of cel]%
} }
\pgfplotscreateplotcyclelist{matplotlib}{%
{Mpl1},{Mpl2},{Mpl3},{Mpl4}
}
% Define individual colors % Define 'scolX' colors
\makeatletter \makeatletter
@ -219,40 +236,52 @@
\makeatother \makeatother
\def\setschemecolors{ \def\setschemecolorsfrommap{
\extractcolormapcolor{scol0}{0} \extractcolormapcolor{scol0}{0}
\extractcolormapcolor{scol1}{333} \extractcolormapcolor{scol1}{333}
\extractcolormapcolor{scol2}{666} \extractcolormapcolor{scol2}{666}
\extractcolormapcolor{scol3}{1000} \extractcolormapcolor{scol3}{1000}
} }
\newcommand{\setschemecolorsmanually}[4]{
\colorlet{scol0}{#1}
\colorlet{scol1}{#2}
\colorlet{scol2}{#3}
\colorlet{scol3}{#4}
}
% Define color schemes % Define color schemes
\pgfplotsset{ \pgfplotsset{
/pgfplots/colorscheme/mako/.style={ /pgfplots/colorscheme/cel/.style={
colormap name={mako}, colormap name={cel},
cycle list name={mako}, cycle list name={cel},
/utils/exec={\setschemecolors}, /utils/exec={\setschemecolorsfrommap},
}, },
/pgfplots/colorscheme/rocket/.style={ /pgfplots/colorscheme/rocket/.style={
colormap name={rocket}, colormap name={rocket},
cycle list name={rocket}, cycle list name={rocket},
/utils/exec={\setschemecolors}, /utils/exec={\setschemecolorsfrommap},
},
/pgfplots/colorscheme/cividis/.style={
colormap name={cividis},
cycle list name={cividis},
/utils/exec={\setschemecolors},
}, },
/pgfplots/colorscheme/viridis/.style={ /pgfplots/colorscheme/viridis/.style={
colormap name={viridis}, colormap name={viridis},
cycle list name={viridis}, cycle list name={viridis},
/utils/exec={\setschemecolors}, /utils/exec={\setschemecolorsfrommap},
}, },
/pgfplots/colorscheme/cel/.style={ /pgfplots/colorscheme/mako/.style={
colormap name={cel}, colormap name={mako},
cycle list name={cel}, cycle list name={mako},
/utils/exec={\setschemecolors}, /utils/exec={\setschemecolorsfrommap},
},
/pgfplots/colorscheme/cividis/.style={
colormap name={cividis},
cycle list name={cividis},
/utils/exec={\setschemecolorsfrommap},
},
/pgfplots/colorscheme/matplotlib/.style={
colormap name={matplotlib},
cycle list name={matplotlib},
/utils/exec={\setschemecolorsmanually{Mpl1}{Mpl2}{Mpl3}{Mpl4}},
}, },
} }

View File

@ -18,7 +18,6 @@
\input{common.tex} \input{common.tex}
\pgfplotsset{colorscheme/cel}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -26,12 +25,26 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Colorschemes}
\author{}
\date{}
\begin{document} \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} \pgfplotsset{colorscheme/\x}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Preview colorscheme
\noindent\begin{minipage}{\textwidth}
\colorbox{gray!30}{\texttt{colorscheme/\x}} \colorbox{gray!30}{\texttt{colorscheme/\x}}
\begin{figure}[H] \begin{figure}[H]
\centering \centering
@ -81,6 +94,8 @@
\end{tikzpicture} \end{tikzpicture}
\end{subfigure}% \end{subfigure}%
\end{figure} \end{figure}
\vspace{\parskip}
\end{minipage}
} }