English

A PDF PSA, or Never gonna set_xscale again -- guilty feats with logarithms

Cosmology and Nongalactic Astrophysics 2020-04-01 v1 Instrumentation and Methods for Astrophysics

Abstract

In the course of doing astronomy, one often encounters plots of densities, for example probability densities, flux densities, and mass functions. Quite frequently the ordinate of these diagrams is plotted logarithmically to accommodate a large dynamic range. In this situation, I argue that it is critical to adjust the density appropriately, rather than simply setting the x-scale to `log' in your favorite plotting code. I will demonstrate the basic issue with a pedagogical example, then mention a few common plots where this may arise, and finally some possible exceptions to the rule.

Cite

@article{arxiv.2003.14327,
  title  = {A PDF PSA, or Never gonna set_xscale again -- guilty feats with logarithms},
  author = {John C. Forbes},
  journal= {arXiv preprint arXiv:2003.14327},
  year   = {2020}
}

Comments

To be submitted to the Astro-pedantic Journal on April 1, 2020

R2 v1 2026-06-23T14:34:03.876Z