next up previous contents index
Next: H.2 Resolution and dots Up: H. Problems with display Previous: H. Problems with display   Contents   Index

H.1 PostScript driver bugs

When you try to display a PostScript file on a device, such as a printer or your screen, then a program called a PostScript device driver has to compute which device pixels should receive which colors (black or white in the case of a simple laser printer) in order to display the file. At this stage, certain device-dependent things may happen. These are not limitations of GMT or PostScript, but of the particular display device. The following bugs are known to us based on our experiences:

  1. Early versions of the Sun SPARCprinter software caused linewidth-dependent path displacement. We reported this bug and it has been fixed in newer versions of the software. Try using psxy to draw $y = f(x)$ twice, once with a thin pen (-W1) and once with a fat pen (-W10); if they do not plot on top of each other, you have this kind of bug and need new software. The problem may also show up when you plot a mixture of solid and dashed (or dotted) lines of various pen thickness

  2. The first version of the HP Laserjet 4M (prior to Aug-93) had bugs in the driver program. The old one was PostScript SIMM, part number C2080-60001; the new one is called PostScript SIMM, part number C2080-60002. You need to get this one plugged into your printer if you have an HP LaserJet 4M.

  3. Apple Laserwriters with the older versions of Apple's PostScript driver will give the error ``limitcheck'' and fail to plot when they encounter a path exceeding about 1000-1500 points. Try to get a newer driver from Apple, but if you can't do that, set the parameter MAX_L1_PATH to 1000-1500 or even smaller in the file src/pslib_inc.h and recompile GMT. The number of points in a PostScript path can be arbitrarily large, in principle; GMT will only create paths longer than MAX_L1_PATH if the path represents a filled polygon or clipping path. Line-drawings (no fill) will be split so that no segment exceeds MAX_L1_PATH. This means psxy -G will issue a warning when you plot a polygon with more than MAX_L1_PATH points in it. It is then your responsibility to split the large polygon into several smaller segments. If pscoast gives such warnings and the file fails to plot you may have to select one of the lower resolution databases The path limitation exemplified by these Apple printers is what makes the higher-resolution coastlines for pscoast non-trivial: such coastlines have to be organized so that fill operations do not generate excessively large paths. Some HP PostScript cartridges for the Laserjet III also have trouble with paths exceeding 1500 points; they may successfully print the file, but it can take all night!

  4. 8-bit color screen displays (and programs which use only 8-bits, even on 24-bit monitors, such as Sun's pageview under OpenWindows) may not dither cleverly, and so the color they show you may not resemble the color your PostScript file is asking for. Therefore, if you choose colors you like on the screen, you may be surprised to find that your plot looks different on the hardcopy printer or film writer. The only thing you can do is be aware of this, and make some test cases on your hardcopy devices and compare them with the screen, until you get used to this effect. (Each hardcopy device is also a little different, and so you will eventually find that you want to tune your color choices for each device.) The rgb color cube in example 11 may help.

  5. Some versions of Sun's OpenWindows program pageview have only a limited number of colors available; the number can be increased somewhat by starting openwin with the option ``openwin -cubesize large''.

  6. Finally, pageview seem to have problems understanding the setpagedevice operator. We recommend you only use pageview on EPS files or use ghostview instead.

  7. Many color hardcopy devices use CMYK color systems. GMT PostScript uses RGB (even if your cpt files are using HSV). The three coordinates of RGB space can be mapped into three coordinates in CMY space, and in theory K (black) is superfluous. But it is hard to get CMY inks to mix into a good black or gray, so these printers supply a black ink as well, hence CMYK. The PostScript driver for a CMYK printer should be smart enough to compute what portion of CMY can be drawn in K, and use K for this and remove it from CMY; however, some of them aren't.

  8. In early releases of GMT we always used the PostScript command r g b setrgbcolor to specify colors, even if the color happened to be a shade of gray ($r=g=b$) or black ($r=g=b=0$). One of our users found that black came out muddy brown when he used FreedomOfPress to make a Versatec plot of a GMT map. He found that if he used the PostScript command g setgray (where $g$ is a graylevel) then the problem went away. Apparently, his installation of FreedomOfPress uses only CMY with the command setrgbcolor, and so 0 0 0 setrgbcolor tries to make black out of CMY instead of K. To fix this, in release 2.1 of GMT we changed some routines in pslib.c to check if ($r=g$ and $r=b$), in which case g setgray is used instead of r g b setrgbcolor.

  9. Recent experience with some Tektronix Phaser printers and with commercial printing shops has shown that this substitution creates problems precisely opposite of the problems our Versatec user has. The Tektronix and commercial (we think it was a Scitex) machines do not use K when you say 0 setgray but they do when you say 0 0 0 setrgbcolor. We believe that these problems are likely to disappear as the various software developers make their codes more robust. Note that this is not a fault with GMT: $r=g=b=0$ means black and should plot that way. Thus, the GMT source code as shipped to you checks whether $r=g$ and $r=b$, in which case it uses setgray, else setrgbcolor. If your gray tones are not being drawn with K, you have two work-around options: (1) edit the source for pslib.c or (2) edit your PostScript file and try using setrgbcolor in all cases. The simplest way to do so is to redefine the setgray operator to use setrgbcolor. Insert the line

    /setgray {dup dup setrgbcolor} def

    immediately following the first line in the file (starts with %!PS.)

  10. Some color film writers are very sensitive to the brand of film. If black doesn't look black on your color slides, try a different film.

next up previous contents index
Next: H.2 Resolution and dots Up: H. Problems with display Previous: H. Problems with display   Contents   Index
Paul Wessel 2004-10-01