Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

GMT_Appendix_H.tex 11 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
  1. %------------------------------------------
  2. % $Id$
  3. %
  4. % The GMT Documentation Project
  5. % Copyright (c) 2000-2012.
  6. % P. Wessel, W. H. F. Smith, R. Scharroo, and J. Luis
  7. %------------------------------------------
  8. %
  9. \chapter{Problems with display of \gmt\ \PS}
  10. \label{app:H}
  11. \thispagestyle{headings}
  12. \GMT\ creates valid (so far as we know) Adobe \PS\
  13. Level 2. It does not use operators specific to Level 3 and
  14. should therefore produce output that should print on all \PS\ printers\footnote{Note, however, that the \Opt{Q} option in \GMTprog{grdimage}
  15. will exercise a \PS\ Level 3 feature called colormasking.}. Sometimes unexpected things
  16. happen when \GMT\ output is sent to certain printers or displays.
  17. This section lists some things we have learned from experience,
  18. and some work-arounds. Note that many of these lessons are now rather old so hopefully
  19. these workarounds no longer apply to anybody...
  20. \section{\PS\ driver bugs}
  21. \index{PostScript@\PS!driver bugs}
  22. When you try to display a \PS\ file on a device,
  23. such as a printer or your screen, then a program called a
  24. \PS\ device driver has to compute which device
  25. pixels should receive which colors (black or white in the case
  26. of a simple laser printer) in order to display the file. At
  27. this stage, certain device-dependent things may happen. These
  28. are not limitations of \GMT\ or \PS, but of the
  29. particular display device. The following bugs are known to us
  30. based on our experiences:
  31. \begin{enumerate}
  32. \index{PostScript@\PS!Sun SPARCprinter bug}
  33. \item Early versions of the Sun SPARCprinter software
  34. caused linewidth-dependent path displacement. We reported
  35. this bug and it has been fixed in newer versions of the software.
  36. Try using \GMTprog{psxy} to draw $y = f(x)$ twice, once with a
  37. thin pen (\Opt{W}1) and once with a fat pen (\Opt{W}10);
  38. if they do not plot on top of each other, you have this kind
  39. of bug and need new software. The problem may also show up
  40. when you plot a mixture of solid and dashed (or dotted) lines
  41. of various pen thickness
  42. \index{PostScript@\PS!HP Laserjet 4M bug}
  43. \item The first version of the HP Laserjet 4M (prior to Aug--93)
  44. had bugs in the driver program. The old one was
  45. \PS\ SIMM, part number C2080-60001; the new one
  46. is called \PS\ SIMM, part number C2080-60002.
  47. You need to get this one plugged into your printer if you have
  48. an HP LaserJet 4M.
  49. \index{PostScript@\PS!limitations|(}
  50. \item Apple Laserwriters with the older versions of Apple's
  51. \PS\ driver will give the error ``limitcheck''
  52. and fail to plot when they encounter a path exceeding about
  53. 1000--1500 points. Try to get a newer driver from Apple, but
  54. if you can't do that, set the parameter MAX\_L1\_PATH to
  55. 1000--1500 or even smaller in the file \filename{src/pslib\_inc.h}
  56. and recompile \GMT. The number of points in a \PS\
  57. path can be arbitrarily large, in principle; \GMT\ will only
  58. create paths longer than MAX\_L1\_PATH if the path represents
  59. a filled polygon or clipping path. Line-drawings (no fill)
  60. will be split so that no segment exceeds MAX\_L1\_PATH.
  61. This means \GMTprog{psxy} \Opt{G} will issue a warning when you
  62. plot a polygon with more than MAX\_L1\_PATH points in it. It is
  63. then your responsibility to split the large polygon into several
  64. smaller segments. If \GMTprog{pscoast} gives such warnings and the
  65. file fails to plot you may have to select one of the lower
  66. resolution databases The path limitation exemplified by these
  67. Apple printers is what makes the higher-resolution coastlines
  68. for \GMTprog{pscoast} non-trivial: such coastlines have to be
  69. organized so that fill operations do not generate excessively
  70. large paths. Some HP \PS\ cartridges for the
  71. Laserjet III also have trouble with paths exceeding 1500
  72. points; they may successfully print the file, but it can take
  73. all night!
  74. \index{PostScript@\PS!limitations|)}
  75. \index{PostScript@\PS!Sun pageview}
  76. \item 8-bit color screen displays (and programs which use only
  77. 8-bits, even on 24-bit monitors, such as Sun's \progname{pageview} under
  78. OpenWindows) may not dither cleverly, and so the color they show you
  79. may not resemble the color your \PS\ file is asking
  80. for. Therefore, if you choose colors you like on the screen,
  81. you may be surprised to find that your plot looks different on
  82. the hardcopy printer or film writer. The only thing you can
  83. do is be aware of this, and make some test cases on your hardcopy
  84. devices and compare them with the screen, until you get used
  85. to this effect. (Each hardcopy device is also a little
  86. different, and so you will eventually find that you want to
  87. tune your color choices for each device.) The rgb color cube
  88. in example 11 may help.
  89. \item Some versions of Sun's OpenWindows program \progname{pageview}
  90. have only a limited number of colors available; the number
  91. can be increased somewhat by starting \progname{openwin} with the
  92. option ``\texttt{openwin -cubesize large}''.
  93. \item Finally, \progname{pageview} seem to have problems understanding
  94. the \texttt{setpagedevice} operator. We recommend you only use
  95. \progname{pageview} on EPS files or use \progname{ghostview} instead.
  96. \index{PostScript@\PS!CMYK and RGB|(}
  97. \item Many color hardcopy devices use CMYK color systems. \GMT\
  98. \PS\ uses RGB (even if your CPT files are using HSV).
  99. The three coordinates of RGB space can be mapped into three
  100. coordinates in CMY space, and in theory K (black) is superfluous.
  101. But it is hard to get CMY inks to mix into a good black or gray,
  102. so these printers supply a black ink as well, hence CMYK. The
  103. \PS\ driver for a CMYK printer should be smart
  104. enough to compute what portion of CMY can be drawn in K, and
  105. use K for this and remove it from CMY; however, some of them
  106. aren't.
  107. \item In early releases of \GMT\ we always used the \PS\
  108. command \texttt{r g b setrgbcolor} to specify colors, even if the color
  109. happened to be a shade of gray ($r=g=b$) or black ($r=g=b=0$). One
  110. of our users found that black came out muddy brown when he used
  111. \progname{FreedomOfPress} to make a Versatec plot of a \GMT\ map.
  112. He found that if he used the \PS\ command \texttt{g setgray} (where $g$
  113. is a graylevel) then the problem went away.
  114. Apparently, his installation of \progname{FreedomOfPress} uses only CMY with
  115. the command \texttt{setrgbcolor}, and so \texttt{0 0 0 setrgbcolor}
  116. tries to make black out of CMY instead of K. To fix this, in
  117. release 2.1 of \GMT\ we changed some routines in \filename{pslib.c}
  118. to check if ($r=g$ and $r=b$), in which case \texttt{g setgray} is
  119. used instead of \texttt{r g b setrgbcolor}.
  120. \item Recent experience with some Tektronix Phaser printers and
  121. with commercial printing shops has shown that this substitution
  122. creates problems precisely opposite of the problems our Versatec
  123. user has. The Tektronix and commercial (we think it was a Scitex)
  124. machines do not use K when you say \texttt{0 setgray} but they do when
  125. you say \texttt{0 0 0 setrgbcolor}. We believe that these problems are
  126. likely to disappear as the various software developers make their
  127. codes more robust. Note that this is not a fault with \GMT:
  128. $r = g = b = 0$ means black and should plot that way.
  129. Thus, the \GMT\ source code as shipped to you checks whether $r=g$
  130. and $r=b$, in which case it uses \texttt{setgray}, else \texttt{setrgbcolor}.
  131. If your gray tones are not being drawn with K, you have two
  132. work-around options: (1) edit the source for \filename{pslib.c}
  133. or (2) edit your \PS\ file and try using \texttt{setrgbcolor}
  134. in all cases. The simplest way to do so is to redefine the
  135. \texttt{setgray} operator to use \texttt{setrgbcolor}.
  136. Insert the line \\
  137. \indent \texttt{/setgray \{dup dup setrgbcolor\} def} \\
  138. immediately following the first line in the file (starts with
  139. \%!PS.)
  140. \item Some color film writers are very sensitive to the brand
  141. of film. If black doesn't look black on your color slides, try
  142. a different film.
  143. \index{PostScript@\PS!CMYK and RGB|)}
  144. \end{enumerate}
  145. \section{European characters}
  146. \index{Text!European}
  147. \index{Characters!European}
  148. Note for users of \progname{pageview} in Sun OpenWindows: \GMT\ now
  149. offers some octal escape sequences to load European alphabet
  150. characters in text strings (see Section~\ref{sec:escape}). When
  151. this feature is enabled, the header on \GMT\ \PS\ output includes
  152. a section defining special fonts. The definition is added to
  153. the header whether or not your plot actually uses the fonts.
  154. Users who view their \GMT\ \PS\ output using
  155. \progname{pageview} in OpenWindows on Sun computers or user older
  156. laserwriters may have difficulties with the European font
  157. definition. If your installation of OpenWindows followed
  158. a space-saving suggestion of Sun, you may have excluded the
  159. European fonts, in which case \progname{pageview} will fail
  160. to render your plot.
  161. Ask your system administrator about this, or run this simple
  162. test: (1) View a \GMT\ \PS\ file with \progname{pageview}.
  163. If it comes up OK, you will be fine. If it comes up blank,
  164. open the ``Edit PostScript'' button and examine the lower
  165. window for error messages. (The European font problem generates
  166. lots of error messages in this window). (2) Verify that the
  167. \PS\ file is OK, by sending it to a laserwriter
  168. and making sure it comes out. (3) If the \PS\
  169. file is OK but it chokes \progname{pageview}, then edit the \PS\
  170. file, cutting out everything between the lines: \\
  171. \noindent
  172. \%\%\%\%\% START OF EUROPEAN FONT DEFINITION \%\%\%\%\% \\
  173. $<$bunch of definitions$>$ \\
  174. \%\%\%\%\% END OF EUROPEAN FONT DEFINITION \%\%\%\%\% \\
  175. Now try \progname{pageview} on the edited version. If it now comes
  176. up, you have a limited subset of OpenWindows installed. If
  177. you discover that these fonts cause you trouble, then you can
  178. edit your \filename{gmt.conf} file to set \textbf{PS\_CHAR\_ENCODING} = Standard,
  179. which will suppress the printing of this definition in the
  180. \GMT\ \PS\ header. You can
  181. make output which will be viewable in \progname{pageview} without
  182. any editing. However, you would have to reset this to TRUE
  183. before attempting to use European fonts, and then the output will
  184. become un-\progname{pageview}-able again. If you try to
  185. concatenate segments of \GMT\ \PS\ made with and without the
  186. European fonts enabled, then you may find that you have problems,
  187. either with the definition, or because you ask for something
  188. not defined.
  189. \section{Hints}
  190. \index{PostScript@\PS!\GMT\ hints}
  191. When making images and perspective views of large amounts of
  192. data, the \GMT\ programs can take some time to run, the resulting
  193. \PS\ files can be very large, and the time to display
  194. the plot can be long. Fine tuning a plot script can take lots
  195. of trial and error. We recommend using \GMTprog{grdsample} to make
  196. a low resolution version of the data files you are plotting, and
  197. practice with that, so it is faster; when the script is perfect,
  198. use the full-resolution data files. We often begin building a
  199. script using only \GMTprog{psbasemap} or \GMTprog{pscoast} to get
  200. the various plots oriented correctly on the page; once this works
  201. we replace the \GMTprog{psbasemap} calls with the actually desired
  202. \GMT\ programs.
  203. If you want to make color shaded relief images and you haven't
  204. had much experience with it, here is a good first cut at the
  205. problem: Set your \textbf{COLOR\_MODEL} to HSV using \GMTprog{gmtset}. Use
  206. \GMTprog{makecpt} or \GMTprog{grd2cpt} to make a continuous color
  207. palette spanning the range of your data. Use the \Opt{Nt}
  208. option on \GMTprog{grdgradient}. Try the result, and then play with
  209. the tuning of the \filename{gmt.conf}, the CPT file, and
  210. the gradient file.
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...