Compare commits

..

6 Commits

7 changed files with 157 additions and 86 deletions

View File

@@ -1,11 +1,11 @@
SRCS=$(shell find examples -type f -name "*.tex") SRCS=$(shell find examples -type f -name "*.tex")
PDFS=$(shell echo $(SRCS:.tex=.pdf) | sed -e "s/examples\\///g") PDFS=$(shell echo $(SRCS:.tex=.pdf) | sed -e "s/examples\\///g")
all: $(PDFS)
%.pdf: examples/%.tex %.pdf: examples/%.tex
latexmk $< latexmk $<
all: $(PDFS)
clean: clean:
rm -rf build rm -rf build

View File

@@ -26,7 +26,7 @@ $ make
```bash ```bash
$ docker build -f dockerfiles/Dockerfile.alpine . -t latex-common $ docker build -f dockerfiles/Dockerfile.alpine . -t latex-common
``` ```
2. Build example 2. Build examples
```bash ```bash
$ docker run --rm -v $PWD:$PWD -w $PWD -u `id -u`:`id -g` latex-common make $ docker run --rm -v $PWD:$PWD -w $PWD -u `id -u`:`id -g` latex-common make
``` ```

View File

@@ -5,7 +5,6 @@
% ||====================================================================|| % ||====================================================================||
% || WARNING || % || WARNING ||
% ||====================================================================|| % ||====================================================================||
% || ||
% || The following packages have to be included before using this file: || % || The following packages have to be included before using this file: ||
% || amsmath || % || amsmath ||
% || pgfplots || % || pgfplots ||
@@ -23,7 +22,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Graphics & Plotting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Data Manipulation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -72,21 +71,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 +138,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 +188,42 @@
color=(kit-green70); color=(kit-green70);
color=(kit-yellow70!80!kit-orange70); color=(kit-yellow70!80!kit-orange70);
}, },
colormap={matplotlib}{
% Source: https://github.com/matplotlib/matplotlib/blob/e5a85f960b2d47eac371cff709b830d52c36d267/lib/matplotlib/_cm.py#L1114
rgb=(0.2298057, 0.298717966, 0.753683153)
rgb=(0.26623388, 0.353094838, 0.801466763)
rgb=(0.30386891, 0.406535296, 0.84495867 )
rgb=(0.342804478, 0.458757618, 0.883725899)
rgb=(0.38301334, 0.50941904, 0.917387822)
rgb=(0.424369608, 0.558148092, 0.945619588)
rgb=(0.46666708, 0.604562568, 0.968154911)
rgb=(0.509635204, 0.648280772, 0.98478814 )
rgb=(0.552953156, 0.688929332, 0.995375608)
rgb=(0.596262162, 0.726149107, 0.999836203)
rgb=(0.639176211, 0.759599947, 0.998151185)
rgb=(0.681291281, 0.788964712, 0.990363227)
rgb=(0.722193294, 0.813952739, 0.976574709)
rgb=(0.761464949, 0.834302879, 0.956945269)
rgb=(0.798691636, 0.849786142, 0.931688648)
rgb=(0.833466556, 0.860207984, 0.901068838)
rgb=(0.865395197, 0.86541021, 0.865395561)
rgb=(0.897787179, 0.848937047, 0.820880546)
rgb=(0.924127593, 0.827384882, 0.774508472)
rgb=(0.944468518, 0.800927443, 0.726736146)
rgb=(0.958852946, 0.769767752, 0.678007945)
rgb=(0.96732803, 0.734132809, 0.628751763)
rgb=(0.969954137, 0.694266682, 0.579375448)
rgb=(0.966811177, 0.650421156, 0.530263762)
rgb=(0.958003065, 0.602842431, 0.481775914)
rgb=(0.943660866, 0.551750968, 0.434243684)
rgb=(0.923944917, 0.49730856, 0.387970225)
rgb=(0.89904617, 0.439559467, 0.343229596)
rgb=(0.869186849, 0.378313092, 0.300267182)
rgb=(0.834620542, 0.312874446, 0.259301199)
rgb=(0.795631745, 0.24128379, 0.220525627)
rgb=(0.752534934, 0.157246067, 0.184115123)
rgb=(0.705673158, 0.01555616, 0.150232812)
}
} }
% Define cycle lists % Define cycle lists
@@ -199,8 +243,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 +266,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

@@ -1,5 +1,4 @@
FROM alpine:3.19 FROM alpine:3.19
RUN apk update && apk upgrade RUN apk update && apk upgrade
RUN apk add texlive RUN apk add make texlive texmf-dist-pictures
RUN apk add texmf-dist-pictures

View File

@@ -3,7 +3,6 @@ FROM archlinux:latest
RUN pacman-key --init RUN pacman-key --init
RUN pacman-key --populate archlinux RUN pacman-key --populate archlinux
RUN pacman -Sy archlinux-keyring --noconfirm && pacman -Su --noconfirm RUN pacman -Sy archlinux-keyring --noconfirm && pacman -Su --noconfirm
# RUN pacman-key --refresh-keys
RUN pacman -Syu --noconfirm RUN pacman -Syu --noconfirm
RUN pacman -S perl texlive texlive-binextra texlive-pictures --noconfirm RUN pacman -S make perl texlive texlive-binextra texlive-pictures --noconfirm

View File

@@ -3,5 +3,4 @@ FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
RUN apt update -y && apt upgrade -y RUN apt update -y && apt upgrade -y
RUN apt install neovim git -y RUN apt install make texlive latexmk texlive-pictures -y
RUN apt install texlive latexmk texlive-pictures -y

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}
} }