latex-common/examples/colorschemes.tex

104 lines
2.3 KiB
TeX

\documentclass{article}
% Packages necessary for common.tex
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
% Other packages
\usepackage{float}
\usepackage{subcaption}
\usepackage[a4paper, total={5in, 9in}]{geometry}
\usetikzlibrary{positioning}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% Set common options %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{common.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% Actual Document %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Colorschemes}
\author{}
\date{}
\begin{document}
\maketitle
\foreach \x in {cel, rocket, viridis, mako, cividis, matplotlib}{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set colorscheme
\pgfplotsset{colorscheme/\x}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Preview colorscheme
\noindent\begin{minipage}{\textwidth}
\colorbox{gray!30}{\texttt{colorscheme/\x}}
\begin{figure}[H]
\centering
\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}
}
\end{document}