Skip to content
Snippets Groups Projects
Forked from agnumpde / dune-tectonic
156 commits ahead of the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
2d-velocity-contours-zoom.tikz 1.49 KiB
\pgfplotsarraynew\contourlevels{%
  1\\3\\
  10\\30\\
  100\\300\\
  1000\\3000\\
}

\def\fname{zoom:rfpitol=100e-7}
\begin{tikzpicture}[trim axis left, trim axis right]
  \begin{axis}[
    max space between ticks=40pt,
    ymax=0.7,
    colormap/jet,
    x tick label style={
      /pgf/number format/.cd,
      fixed, fixed zerofill, precision=2,
      1000 sep={},
      /tikz/.cd
    },
    y tick label style={
      /pgf/number format/.cd,
      fixed, fixed zerofill, precision=2,
      /tikz/.cd
    },
    tick label style={font=\footnotesize},
    label style={font=\small},
    legend style={font=\small,
                  at={(1.05,1)},
                  anchor=north west,
                  fill=none},
    ylabel = distance from trench, y unit = m,
    xlabel = time, x unit=s,
    width = 12cm, height = 6.5cm,
    legend cell align=right,
    enlargelimits=false,
    contour/labels=false,
    semithick]

    \pgfplotsinvokeforeach{0,...,6} { % level 7 is empty
      \pgfplotscolormapaccess[0:7]{#1}{jet}
      \def\TEMP{\definecolor{mycolor#1}{rgb}}
      \expandafter\TEMP\expandafter{\pgfmathresult}
      \def\fnameX{generated/2d-velocity-contours:\fname:level:%
        \pgfplotsarrayvalueofelem#1\of\contourlevels.tex}
      \addplot[contour prepared={draw color=mycolor#1}, forget plot] table \fnameX;
      \addlegendimage{line legend,color=mycolor#1}
      \addlegendentry{%
        \SI{\pgfplotsarrayvalueofelem#1\of\contourlevels}{\micro\meter/\second}}
    };
  \end{axis}
\end{tikzpicture}