Commits

J.S. Oishi  committed a5260d2

ready to go

  • Participants
  • Parent commits 6eaf475

Comments (0)

Files changed (2)

File advanced_visualization.tex

 
 \fullimage{projection_frb.png}
 \bigsimple{This looks \emph{terrible}!}
-\bigsimple{But it's really awesome.}
+\bigsimple{But \textcolor{blue}{conceptually}, it's really awesome.}
 
 \begin{frame}[t]{\emph{Everything} is a unique object}
   \begin{itemize}[<+->]
 \end{frame}
 
 \begin{frame}
-  Everything is swappable.\\Everything is configurable.\\Everything is illuminated.
+  Everything is swappable.\\Everything is configurable.\\Everything is \textcolor{blue}{illuminated}.
 \end{frame}
 
 \begin{frame}[fragile,t]{Let's try again}
 
 \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}
   <<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

File scripts/profile3.py

+import pylab as P
+from yt.mods import *
+
+pf  = load("data/enzo_tiny_cosmology/DD0042/DD0042")
+c = pf.h.find_max("Density")[1]
+sph = pf.h.sphere(c, 10./pf['mpc']) # a 1 Mpc sphere
+prof = BinnedProfile1D(sph, 32, "RadiusMpc", 1, 10)
+prof.add_fields("Density")
+prof.add_fields("Temperature")
+
+fig = P.figure()
+d_ax = fig.add_axes([0.15,0.1,0.80,0.35])
+t_ax = fig.add_axes([0.15,0.45,0.80,0.35])
+
+d_ax.loglog(prof['RadiusMpc'], prof['Density'], 
+         lw=2.5, linestyle='-.',color="#E7298A")
+t_ax.loglog(prof['RadiusMpc'], prof['Temperature'], 
+         lw=2.5, linestyle='-',color="#66A61E")
+
+for loc, spine in d_ax.spines.iteritems():
+    if loc == 'left':
+        spine.set_smart_bounds(True)
+        spine.set_alpha(0.4)
+    else:
+        spine.set_color('none') # don't draw spine
+d_ax.xaxis.set_ticks([])#_position('top')
+d_ax.xaxis.set_ticks_position('top')
+d_ax.yaxis.set_ticks_position('left')
+
+for loc, spine in t_ax.spines.iteritems():
+    if loc == 'bottom' or loc == 'left':
+        spine.set_smart_bounds(True)
+        spine.set_alpha(0.4)
+    else:
+        spine.set_color('none') # don't draw spine
+
+t_ax.yaxis.set_ticks_position('left')
+t_ax.xaxis.set_ticks_position('bottom')
+t_ax.xaxis.set_ticks([10])
+for t in t_ax.xaxis.get_ticklabels() + t_ax.yaxis.get_ticklabels() + d_ax.yaxis.get_ticklabels():
+    t.set_alpha(0.5)
+
+for m in [True, False]:
+    for t in t_ax.xaxis.get_ticklines(minor=m) + t_ax.yaxis.get_ticklines(minor=m) + d_ax.xaxis.get_ticklines(minor=m) + d_ax.yaxis.get_ticklines(minor=m):
+        t.set_alpha(0.5)
+
+t_ax.yaxis.set_ticks([1e6,1e7])
+t_ax.set_xlabel(r'Radius (Mpc)', fontsize=16,alpha=0.5)
+d_ax.set_ylabel(r'$\mathrm{Density\ (g\ cm^{-3})}$', fontsize=16, alpha=0.5)
+t_ax.set_ylabel(r'Temperature (K)', fontsize=16, alpha=0.5)
+
+fig.savefig('density_profile_finished.png')