Fanning Software Consulting

Coyote Library PostScript Files

These are programs from the Coyote Library that are specifically designed to work with PostScript output.



This function calculates and returns the normalized position coordinates necessary to put a plot with a specified aspect ratio into the currently active graphics window. This makes it easy to produce PostScript output in the correct dimensions for measuring. For example, here is how I create a plot that is 2 units tall and 3 units wide:
   cgPlot, data, Position=cgAspect(2.0/3.0)

The program has been updated to also work with a page of PostScript or Printer output. For example, I use it to keep the correct aspect ratio of a graphics plot when I send the plot directly to the printer (via the Printer device). For example, here is code I use in an object graphics program to make the graphics output appear on the printed page with the same aspect ratio as in the display window:

   info.thisWindow->GetProperty, Dimensions=wdims
   plotAspect = Float(wdims[1]) / wdims[0]
   windowAspect = 11.0 / 8.5 ; Letter page. Modify for A4 page.

	; Calculate the proper position on the PostScript page.

   position = cgAspect(plotAspect, WindowAspect=windowAspect)

	; Change the dimension and location of the view to page mapping.

   info.thisView->SetProperty, Dimensions=[position[2]-position[0], position[3]-position[1]], $
      Location=[position[0], position[1]], Units=3

      ; Print the document.

   info.thisPrinter->Draw, info.thisView, Vector=info.vector



This program is my long-awaited replacement for PS_Form. Everything I did wrong in PS_Form, I tried to do right here. This program is written as an object, which makes it trivially easy to extend and maintain. I made it easy to add your own system defaults, help screens, custom set-ups, paper sizes, etc. This is a program that should never grow out of date.

The FSC_PSConfig GUI.

This program is the most sophisticated I have ever offered for free, and one of the most sophisticated I have ever written. I was trying to push and extend a number of ideas I am writing about in an upcoming IDL object programming book. Pushing the envelope in terms of what is possible is the only way I know to see how far I can really go. To that end, I am not recommending this program to anyone using versions of IDL older than IDL 5.2. Moreover, you really should use it on a 24-bit display, although it will work on an 8-bit display. (It just won't look as nice, and it will probably cause color flashing if you have other graphics on this display, as it uses the IDL object graphics class library.) The program works wonderfully well on my Windows NT 4 machine running IDL 5.3. Your mileage may vary.

I've tested the program on as many machines as I can get my hands on, but I'm pretty sure it is not bug free. And I am pushing the notion of "cross-platform compatibility" as hard as I can. Please let me know if you discover problems.

Because this program is as sophisticated as it is, I've written a complete on-line help page to show you how to use it. Plus, for people who really don't want to know anything about it, there is a wrapper function, PSConfig, that provides a simplified function interface to the object's graphical user interface and configuration keyword methods. PSConfig works very much like my older program, PS_Form.

One of the feature's of this program is that it relies on a number of compound widget objects, which you will have to download to use with the program. These are: FSC_Droplist, FSC_FileSelect, FSC_Field, and FSC_PlotWindow. All of these programs, as well as PSConfig and PS_Plotter, an example program showing one way to use the object, are available in the Coyote Library. For additional information, please see the on-line help page.

The program is now updated (9 November 2007) to allow CMYK output.

Version of IDL used to prepare this article: IDL 7.0.1.

Last Updated: 20 March 2011