Source

yt.workshop2012.advanced_visualization / advanced_visualization.tex

\documentclass[14pt]{beamer}
\newcommand{\bigsimple}[1]{
  \begin{frame}[c]{}
  \begin{center}
    {\huge \textbf{#1} }
  \end{center}
  \end{frame}
}
\newcommand{\mediumsimple}[1]{
  \begin{frame}[c]{}
  \begin{center}
    \textbf{#1}
  \end{center}
  \end{frame}
}
\newcommand{\fullimage}[1]{
  {
    \usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{#1}}
    \begin{frame}[plain]{}
    \end{frame}
  }
}
\newcommand{\defslide}[2]{
  \begin{frame}[t]{}
  \begin{center}
  ``#1''
  \end{center}
  \\
  \vspace{1in}
  \\
  #2
  \end{frame}
}
\newcommand{\classtxt}[1]{
  \texttt{\textcolor{red}{#1}}
}

\setbeamercolor{normal text}{bg=black,fg=white}
\setbeamertemplate{navigation symbols}{}
\usecolortheme[named=white]{structure}
\usetheme{default}
\usepackage{relsize}
\newcommand{\yt}{{\larger\texttt{yt}}}

\usepackage[english]{babel}
% or whatever

\usepackage[latin1]{inputenc}
% or whatever

%\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{tgadventor}

\usepackage{graphicx}
\usepackage{color}
\definecolor{orange}{rgb}{1,0.5,0}
\usepackage{fancyvrb}
\usepackage{../pastie}

\title{\yt{}: Advanced Visualization}

\begin{document}

\begin{frame}
 \titlepage
\end{frame}

\mediumsimple{``Advanced'' $\mapsto$ fiddling with details.}

\begin{frame}[t]{We've all had to deal with}
  \begin{itemize}
    \item ``Make the fonts bigger''
    \item ``Can you put the colorbar on top?''
    \item ``Can you do it again, but this time louder?''
    \item ``Come on. That's too loud. Tone it down.''
  \end{itemize}
\end{frame}

\begin{frame}[t]{Topics}
  \begin{itemize}
  \item Callbacks and modifying plots
  \item \texttt{FixedResolutionBuffers}
  \item Getting reduced data from yt to plug in to matplotlib.
  \item Combining multiple data sources.
  \item My obnoxious, highly opinionated ideas about making plots
  \end{itemize}
\end{frame}

\mediumsimple{PlotCollections are designed to be \emph{easy}.\\This is not always compatible with \emph{general}.}

\begin{frame}[fragile,t]{}
\tiny
<<d['scripts/yt_pc.py|fn|pyg|l']>>
\hline
<<d['scripts/yt_pc.py|fn|py|pyg|l']>>
\end{frame}

\fullimage{DD0001_Slice_y_Density.png}

\mediumsimple{However, PlotCollections are the most \emph{feature rich} plotting tools in \yt{}.\\\\ Think back to Stephen Skory \& John ZuHone's talk yesterday}

\bigsimple{Plot Modifications (aka ``Callbacks'')}

\begin{frame}[fragile,t]{A Simple Example}
\tiny
<<d['scripts/pc_callback.py|fn|pyg|l']>>
\end{frame}

\fullimage{grid_Slice_y_Density.png}

\mediumsimple{This is not terribly useful here.}

\begin{frame}[fragile,t]{Velocity Vectors}
  \tiny
  <<d['scripts/pc_vel_callback.py|fn|pyg|l']>>
\end{frame}

\fullimage{vel_Slice_y_Density.png}

\bigsimple{I want to tweak...everything.}

\fullimage{temp_density_phase.png}

\mediumsimple{The Key to Ultimate Plot Flexibility is \emph{getting the components}.}

\begin{frame}[fragile,t]{FixedResolutionBuffers}
  \tiny
  <<d['scripts/frb.py|fn|pyg|l']>>
\end{frame}

\fullimage{projection_frb.png}
\bigsimple{This looks \emph{terrible}!}
\bigsimple{But \textcolor{blue}{conceptually}, it's really awesome.}

\begin{frame}[t]{\emph{Everything} is a unique object}
  \begin{itemize}[<+->]
    \item the \textcolor{blue}{data} is in the \classtxt{proj} object
    \item the \textcolor{blue}{pixels} are in the \classtxt{FixedResolutionBuffer} object
    \item the \textcolor{blue}{figure} is a matplotlib \classtxt{Figure} object
    \item and those pixels are \textcolor{blue}{drawn} via the \classtxt{imshow} method of \classtxt{axes}  
  \end{itemize}
\end{frame}

\begin{frame}
  Everything is swappable.\\Everything is configurable.\\Everything is \textcolor{blue}{illuminated}.
\end{frame}

\begin{frame}[fragile,t]{Let's try again}
  \tiny
  <<d['scripts/frb_2.py|fn|pyg|l']>>
\end{frame}
\fullimage{log_projection_frb.png}

\bigsimple{What about Profiles?}

\begin{frame}[fragile,t]{Make a profile object}
  \tiny
  <<d['scripts/profile.py|fn|pyg|l']>>
  \hline
  \tiny
  <<d['scripts/profile.py|fn|py|pyg|l']>>  
\end{frame}

\begin{frame}[fragile,t]{These are just numpy arrays!}
  \tiny
  <<d['scripts/profile.py|fn|py|pyg|l']>>  
\end{frame}

\begin{frame}[fragile,t]{So, let's plot them.}
  \tiny
  <<d['scripts/profile2.py|fn|pyg|l']>>  
\end{frame}

\fullimage{density_profile.png}

\bigsimple{Say you want to make this \emph{beautiful}}

\begin{frame}[fragile,t]
  \tiny
  <<d['scripts/profile3.py|fn|pyg|l']>>  
\end{frame}

\fullimage{density_profile_finished.png}


\bigsimple{Let's get more complicated.}

\begin{frame}[fragile,t]{Example: Overlaying Profiles on Phase Plots}
  \tiny
  <<d['scripts/phase_overlay.py|fn|pyg|l']>>
\end{frame}

\fullimage{temp_density_phase.png}

\end{document}

%%  LocalWords:  colorbar FixedResolutionBuffers yt matplotlib fn pyg
%%  LocalWords:  PlotCollections vel png frb proj imshow py numpy
%%  LocalWords:  FixedResolutionBuffer