Fanning Software Consulting

Line Thickness to Point Size

QUESTION: What is the relationship between line thickness in IDL and point size in PostScript? I need to know because my editor tells me that lines in my figures must have a minimum point size of 0.5. Say what!?

ANSWER: The easiest way to find this out is to create a simple PostScript plot in IDL with a line thickness of 1. Then, open the file in Adobe Illustrator or Corel Draw. Simply selecting the line will give you access to its point size in the program. If you don't own Illustrator or Corel Draw, don't go out and buy them. You can learn the point size by simply opening the PostScript file up in a text editor. Look for this line:

   $IDL_DICT begin 54 360 translate 0.0283465 dup scale

The number after the word translate is what you are looking for. If you mulitply this number by 10, this is the point size of a normal THICK=1 line in IDL. A line that is twice this thick has a point size of 2 * 0.0283465 * 10 = 0.566930.

In your case, you can find the correct thickness by solving this equation:

   IDL> myThick = 0.5 / (0.0283465 * 10)
   IDL> Print, myThick
         1.76389

You would draw your plot with these thicknesses:

   cgPS_Open, 'myfile_thick.ps'
   cgPlot, findgen(11), Thick=myThick, XThick=myThick, YThick=mythick, Font=0
   cgPS_Close

If you configure your PostScript device with cgPS_Open, as in the code above, one of the many benefits is that you do not have to use the "thick" keywords like this. cgPS_Open automaticaly sets these thickness keywords (via the system variables) to three times the normal thickness (e.g., !P.Thick=3) so that your PostScript output has approximately the same "weight" as what you see on the display. True-type fonts are also selected automatically. This means that in most cases, all you need to do to produce "thicker" PostScript plots is this.

   cgPS_Open, 'myfile.ps'
   cgPlot, findgen(11)
   cgPS_Close

The advantage of thicker PostScript plots is that they can more easily be converted to high quality raster files.

[Return to IDL Programming Tips]