Author Archives: gbb

matplotlib.rc customizations for fonts

I’ve long struggled with modifying the fonts for matplotlib plots from the default “Bitstream Vera Sans” until I found this post recently. The steps outlined there worked quite well for changing the general font used for the plots, but escaped … Continue reading

Posted in Tips, Uncategorized | Tagged , , | Leave a comment

Add border around text with matplotlib

Sometimes text labels on plots can be hidden if there is too little contrast with a background color.  You can add borders to text objects (and probably most other patches) with “PathEffects“, see also http://matplotlib.org/examples/pylab_examples/patheffect_demo.html. Below is an example:

Posted in Uncategorized | Leave a comment

Extract numerical data from a published graphic (matplotlib)

The ADS “Dexter” application (http://dexter.sourceforge.net/) allows you to extract quantitative data from old published graphics, or data from a graphic where an accompanying table was not provided with the numerical values plotted in the graphic. I wrote a simple script … Continue reading

Posted in Uncategorized | Leave a comment

Rasterized graphics with Matplotlib to preserve plot transparencies for ApJ figures

Some of the astronomical research journals (ApJ, ApJL, others?) still require that figures be submitted in (encapsulated) postscript format. Since we’re otherwise living in the second decade of the 21st century, our figures frequently contain elements supported by the PDF … Continue reading

Posted in Uncategorized | Leave a comment

Install SCAMP

I received a new laptop that already had many things precompiled and installed, like SExtractor. The unix libraries are an ugly mix of macports in /sw/ and my own homebrew installations described as in some of the posts below. I … Continue reading

Posted in Uncategorized | Leave a comment

Replace laptop DVD drive with a solid state drive

This idea comes courtesy of a colleague of mine and falls squarely in the category of “wish I’d thought of that a long time ago.” HDs and astronomical detector formats appear to grow at about the same rate, so there’s … Continue reading

Posted in Uncategorized | Leave a comment

Homebrew python: default interactive plotting with Matplotlib

One thing I noticed with my homebrew installation of matplotlib was that the interactive plotting was disabled by default. Turning it on was a simple matter of finding and editing the matplotlibrc file: I set the following lines: # backend … Continue reading

Posted in Tips | Tagged | Leave a comment