Category Archives: Uncategorized

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

Python setup with HomeBrew

HomeBrew offers a nice way of installing a Python distribution with a single command.  As usual, it puts the files releated to the installation in /usr/local/Cellar and symlinks the necessary things to /usr/local/[bin/lib/include], but it also is a bit more … Continue reading

Posted in Uncategorized | 2 Comments

Install PyMC on OSX, Python2.7

I came across a number of compile problems when trying to install PyMC with the latest STSCI_PYTHON and Python2.7. The main problem appears to stem from the version of gfortran that the install scripts found in /sw/bin, perhaps shipped with … Continue reading

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

sudo not using $PYTHONPATH

I’ve come across this problem before, but today I was trying to install some Python packages after downloading the newest version of STSCI_PYTHON. Using easy_install requires root access to write the install files, so one would have to use, for … Continue reading

Posted in Uncategorized | Leave a comment

Python C-extensions with Cython

Cython is a package for developing C-extensions that can be easily used in python. The primary benefit is that the code compiled in Cython can (optionally) written in pure python, just as it would be used in a python script. … Continue reading

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