SLxfig

 

SLxfig is a S-Lang package that produces plots, drawings, etc in a variety of formats (.ps, .eps, .png, .jpeg,...). It accomplishes this via S-Lang functions that automatically run Xfig's fig2dev and LaTeX to produce the desired output format. See the examples page for some sample publication-quality plots and the code that produced them.

History

In October of 2003 I was asked to give a talk at a workshop on modeling pileup in the Chandra CCDs and was told that it should be an electronic presentation using, for example, powerpoint. I installed the OpenOffice version of powerpoint and started working on the presentation. After about 30 minutes of frustration, I turned to xfig, which is a very flexible and simple to use drawing program familiar to many scientists and engineers.

Using xfig, I proceeded to draw several grids representing the CCD pixels. At some point, I wanted to go back and change the orientation of some of the grids such as changing vertical lines to diagonal ones. Unfortunately, this would require recreating the grids, which would take time. But what if I was not happy with the new orientation and wanted to try another one? Clearly, a manual approach was not going to work. So I started to look for an automated approach to xfig. I searched the web and found the specification of the xfig file format and proceeded to write a S-Lang script to automatically generate the appropriate .fig file from a mathematical description of the object as coded in S-Lang. SLxfig was born.

The following set of SLxfig-generated figures, which shows two perspectives of a pair photons interacting in the CCD, illustrates the solution to the orientation problem described above.

2photon_b.png 2photon_b.png

See the updated version of the pileup-presentation for more examples of SLxfig generated drawings and plots.


This page was last updated Jan 5, 2014 by John E. Davis. To comment on it or the material presented here, send email to jed at jedsoft org.
Valid HTML 4.01! Made with JED Viewable With Any Browser