Friday, October 14, 2011


Why didn't I know this package existed before?

Functions Include:
  • Various cosmological densities.
  • Various cosmological distance measures.
  • Galaxy luminosity functions (Schechter functions).
  • Conversion in and out of the AB magnitude system.
  • Pre-defined sets of cosmological parameters (e.g. from WMAP).
  • Perturbation theory and the power spectrum.
  • The reionization of the IGM.
Very cool!

Thursday, October 13, 2011

More python plotting tricks

I absolutely love these python plotting page with examples:

Today I figured out how to change the fonts of the legend on my plot, and add a shadow. (Pretty exciting I know.) I've also made the lines a little bit thicker, and different styles (so that it looks pretty in black and white printing of the paper).

Below is the code/plot:

from matplotlib.font_manager import fontManager, FontProperties
font= FontProperties(size=24);

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(chi, probsqso, 'k-', label = '$\mathrm{QSOs}$', linewidth=2.0)
ax.plot(chi, probsqsow, 'k:', label = '$\mathrm{QSOs\\ Weighted}$', linewidth=2.0)
ax.plot(chi, prob, 'k--', label = '$\mathrm{Gals}$', linewidth=2.0)

ax.set_xlabel("$\\chi$", fontsize=24)
ax.set_ylabel("$\mathrm{Normalized\ }dN/d\\chi$",fontsize=24)