<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2002-2-1 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>7.19 Color patterns on maps</TITLE> <META NAME="description" CONTENT="7.19 Color patterns on maps"> <META NAME="keywords" CONTENT="GMT_Docs"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="GMT_Docs.css"> <LINK REL="next" HREF="node141.html"> <LINK REL="previous" HREF="node139.html"> <LINK REL="up" HREF="node121.html"> <LINK REL="next" HREF="node141.html"> </HEAD> <BODY bgcolor="#ffffff"> <!--Navigation Panel--> <A NAME="tex2html4616" HREF="node141.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html4610" HREF="node121.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html4604" HREF="node139.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html4612" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html4614" HREF="node256.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html4617" HREF="node141.html">7.20 Custom plot symbols</A> <B> Up:</B> <A NAME="tex2html4611" HREF="node121.html">7. Creating GMT Graphics</A> <B> Previous:</B> <A NAME="tex2html4605" HREF="node139.html">7.18 Volumes and Spatial</A> <B> <A NAME="tex2html4613" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html4615" HREF="node256.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION0015190000000000000000"></A> <A NAME="24565"></A> <A NAME="24566"></A> <BR> 7.19 Color patterns on maps </H1> <P> <A NAME="tex2html1446" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> 3.1 introduced color patterns and this examples give a few cases of how to use this new feature. We make a phony poster that advertises an international conference on <A NAME="tex2html1447" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> in Honolulu. We use <A NAME="tex2html1448" HREF="../man/grdmath.html"><I><B>grdmath</B></I></A><A NAME="25432"></A>, <A NAME="tex2html1449" HREF="../man/makecpt.html"><I><B>makecpt</B></I></A><A NAME="25437"></A>, and <A NAME="tex2html1450" HREF="../man/grdimage.html"><I><B>grdimage</B></I></A><A NAME="25442"></A> to draw pleasing color backgrounds on maps, and overlay <A NAME="tex2html1451" HREF="../man/pscoast.html"><I><B>pscoast</B></I></A><A NAME="25447"></A> clip paths to have the patterns change at the coastlines. The middle panel demonstrates a simple <A NAME="tex2html1452" HREF="../man/pscoast.html"><I><B>pscoast</B></I></A><A NAME="25452"></A> call where the built-in pattern # 86 is drawn at 100 dpi but with the black and white pixels replaced with color combinations. At the same time the ocean is filled with a repeating image of a circuit board (provides in Sun raster format). The text <A NAME="tex2html1453" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> in the center is an off-line <I>PostScript</I> file that was overlaid using <A NAME="tex2html1454" HREF="../man/psimage.html"><I><B>psimage</B></I></A><A NAME="25461"></A>. The final panel repeats the top panel except that the land and sea images have changed places (Figure <A HREF="#fig:GMT_example_19">7.19</A>). <P> <BR CLEAR="ALL"> <HR> <BR> <PRE>#!/bin/sh # GMT EXAMPLE 19 # # Purpose: Illustrates various color pattern effects for maps # GMT progs: gmtset, grdimage, grdmath, makecpt, pscoast, pstext, psimage # Unix progs: rm # ps=example_19.ps # First make a worldmap with graded blue oceans and rainbow continents gmtset COLOR_MODEL rgb grdmath -Rd -I1 Y COSD 2 POW = lat.nc grdmath -Rd -I1 X Y ABS 90 NEQ MUL = lon.nc echo "0 white 1 blue" > lat.cpt makecpt -Crainbow -T-180/180/60 -Z > lon.cpt grdimage lat.nc -Sl -JI0/6.5i -Clat.cpt -P -K -Y7.5i -B0 > $ps pscoast -R -J -O -K -Dc -A5000 -Gc >> $ps grdimage lon.nc -Sl -J -Clon.cpt -O -K >> $ps pscoast -R -J -O -K -Q >> $ps pscoast -R -J -O -K -Dc -A5000 -Wthinnest >> $ps echo "0 20 32 0 1 CM 9TH INTERNATIONAL" | pstext -R -J -O -K -Gred -Sthinner >> $ps echo "0 -10 32 0 1 CM GMT CONFERENCE" | pstext -R -J -O -K -Gred -Sthinner >> $ps echo "0 -30 18 0 1 CM Honolulu, Hawaii, April 1, 2011" | pstext -R -J -O -K -Ggreen -Sthinnest >> $ps # Then show example of color patterns and placing a PostScript image pscoast -R -J -O -K -Dc -A5000 -Gp100/86:FredByellow -Sp100/circuit.ras -B0 -Y-3.25i >> $ps echo "0 30 32 0 1 CM SILLY USES OF" | pstext -R -J -O -K -Glightgreen -Sthinner >> $ps echo "0 -30 32 0 1 CM COLOR PATTERNS" | pstext -R -J -O -K -Gmagenta -Sthinner >> $ps psimage -C3.25i/1.625i/CM -W3i GMT_covertext.eps -O -K >> $ps # Finally repeat 1st plot but exchange the patterns grdimage lon.nc -Sl -J -Clon.cpt -O -K -Y-3.25i -B0 -U"Example 19 in Cookbook" >> $ps pscoast -R -J -O -K -Dc -A5000 -Gc >> $ps grdimage lat.nc -Sl -J -Clat.cpt -O -K >> $ps pscoast -R -J -O -K -Q >> $ps pscoast -R -J -O -K -Dc -A5000 -Wthinnest >> $ps echo "0 20 32 0 1 CM 9TH INTERNATIONAL" | pstext -R -J -O -K -Gred -Sthinner >> $ps echo "0 -10 32 0 1 CM GMT CONFERENCE" | pstext -R -J -O -K -Gred -Sthinner >> $ps echo "0 -30 18 0 1 CM Honolulu, Hawaii, April 1, 2011" | pstext -R -J -O -Ggreen -Sthinnest >> $ps rm -f l*.nc l*.cpt .gmt* </PRE> <BR CLEAR="ALL"> <HR> <DIV ALIGN="CENTER"><A NAME="fig:GMT_example_19"></A><A NAME="25467"></A> <TABLE> <CAPTION ALIGN="BOTTOM"><STRONG>Figure 7.19:</STRONG> Using color patterns and additional PostScript material in illustrations.</CAPTION> <TR><TD> <DIV ALIGN="CENTER"><IMG WIDTH="500" HEIGHT="748" ALIGN="BOTTOM" BORDER="0" SRC="img180.png" ALT="\includegraphics[width=0.9\textwidth]{scripts/example_19}"></DIV></TD></TR> </TABLE> </DIV> <P> <A NAME="24577"></A> <A NAME="24578"></A> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html4616" HREF="node141.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html4610" HREF="node121.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html4604" HREF="node139.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html4612" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html4614" HREF="node256.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html4617" HREF="node141.html">7.20 Custom plot symbols</A> <B> Up:</B> <A NAME="tex2html4611" HREF="node121.html">7. Creating GMT Graphics</A> <B> Previous:</B> <A NAME="tex2html4605" HREF="node139.html">7.18 Volumes and Spatial</A> <B> <A NAME="tex2html4613" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html4615" HREF="node256.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> Paul Wessel 2010-07-14 </ADDRESS> </BODY> </HTML>