Hungry for Plots? Get some APLpy!

Today APLpy 0.9.3 is out! It is a Python plotting package made to generate publication-quality plots in multiple formats such as EPS, PDF, PS, PNG, and SVG.

APLpy was created by Thomas Robitaille and Eli Bressert, who come from a Fortran and IDL background. With Python’s ease of use, portability, and programming they decided to make a plotting package for astronomers. APLpy’s objective is easy usage with great looking publication plots. In other words, more bang for the buck. Here’s an example of what an APLpy plot looks like:

A color generated APLpy plot from FITS files with grid lines.

To see more examples and how to make the plots in Python check out this link.

APLpy has quite a few features (some listed below – from the APLpy site) and is continuing to expand. Fortunately, there’s good documentation to accompany the features.

  • Make plots interactively or using scripts
  • Show grayscale, colorscale, and 3-color RGB images of FITS files
  • Generate co-aligned FITS cubes to make 3-color RGB images
  • Overlay any number of contour sets
  • Overlay markers with fully customizable symbol
  • Plot customizable shapes like circles, ellipses, and rectangles
  • Overlay coordinate grids
  • Customize the appearance of labels and ticks
  • Hide, show, and remove different contour and marker layers
  • Pan, zoom, and save any view as a full publication-quality plot
  • Save plots as EPS, PDF, PS, PNG, and SVG

The plotting package is under active development and there has been extensive interaction between the users and developers. We should be seeing some exciting features added to APLpy in the next few releases.

8 comments… add one
  • kelle Jul 20, 2009 @ 22:54

    can it make a sun symbol in postscript fonts!?! 😉

  • kelle Jul 20, 2009 @ 22:57

    I couldn’t access the APLpy gallery: https://sourceforge.net/apps/gallery/aplpy/index.php. It asked for a password…

  • Eli Jul 21, 2009 @ 5:54

    The link to the gallery has been fixed. It was not supposed to ask an email and password, so that was an error .

    Make a sun symbol in postscript fonts, now that’s a challenge! I’ll see if that can be done 😉

  • Jessica Jul 21, 2009 @ 15:56

    How does this compare to ds9 or matplotlib? Does it use matplotlib underneath? And is this an eventual ds9 replacement? Just curious how you see the new package fitting in.

    Can’t wait to play with it!

    You might request that it gets included with the scisoft astronomy application bundle.

  • Eli Jul 21, 2009 @ 19:06

    Thank you for the suggestion about scisoft! I’ll look into that 🙂

    APLpy uses matplotlib, where its capabilities are extended for plotting FITS data. APLpy is not a replacement to ds9. In fact the APLpy developers are working with the ds9 team some projects.

    In my view, ds9 is a necessary and powerful utility to dynamically explore FITS data. APLpy is a high end Pythonic FITS plotting package. They could be used as complimentary tools for astronomers.

  • sjoert Jul 20, 2010 @ 8:54

    I’ve used APLpy to display optical images with radio contours and catalog overlays. I like it very much.

  • BF Nov 2, 2011 @ 3:33

    I am not sure if this is the right place to get help on APLpy. I don’t seem to find any help forum on the web. I am not a python expert. This program is very nice for making fits image plots. There are few features missing from APLpy. though. For example, I made a plot with fits image subplots. I was hoping to be able to set a universal title, x label and y label for the plot instead of x and y labels for individual subplots. Also, it would be nice if we could adjust the tickmark spacing for the colorbar and add a unit for it. At the moment, line width for the colorbar isn’t working.

    Since the above features aren’t available for APLpy, I am wondering if it is possible to import some features from matplotlib.pyplot and use them under APLpy? For example, I could somehow use axes.set_title from matplotlib. How?

  • Tom Nov 2, 2011 @ 9:04

    @BF – for help with APLpy you can use the relatively new Google group here. To request features, you can open a ticket here. To answer your question you can create a matplotlib figure and pass the instance variable to FITSFigure with figure=, which means you can then call all the normal methods like set_title.

Leave a Reply

Your email address will not be published. Required fields are marked *