<!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="node143.html"> <LINK REL="previous" HREF="node141.html"> <LINK REL="up" HREF="node123.html"> <LINK REL="next" HREF="node143.html"> </HEAD> <BODY bgcolor="#ffffff"> <!--Navigation Panel--> <A NAME="tex2html4718" HREF="node143.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html4712" HREF="node123.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html4706" HREF="node141.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html4714" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html4716" HREF="node258.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html4719" HREF="node143.html">7.20 Custom plot symbols</A> <B> Up:</B> <A NAME="tex2html4713" HREF="node123.html">7. Creating GMT Graphics</A> <B> Previous:</B> <A NAME="tex2html4707" HREF="node141.html">7.18 Volumes and Spatial</A> <B> <A NAME="tex2html4715" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html4717" HREF="node258.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION0015190000000000000000"></A> <A NAME="25066"></A> <A NAME="25067"></A> <BR> 7.19 Color patterns on maps </H1> <P> <A NAME="tex2html1516" 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="tex2html1517" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> in Honolulu. We use <A NAME="tex2html1518" HREF="../man/grdmath.html"><I><B>grdmath</B></I></A><A NAME="25933"></A>, <A NAME="tex2html1519" HREF="../man/makecpt.html"><I><B>makecpt</B></I></A><A NAME="25938"></A>, and <A NAME="tex2html1520" HREF="../man/grdimage.html"><I><B>grdimage</B></I></A><A NAME="25943"></A> to draw pleasing color backgrounds on maps, and overlay <A NAME="tex2html1521" HREF="../man/pscoast.html"><I><B>pscoast</B></I></A><A NAME="25948"></A> clip paths to have the patterns change at the coastlines. The middle panel demonstrates a simple <A NAME="tex2html1522" HREF="../man/pscoast.html"><I><B>pscoast</B></I></A><A NAME="25953"></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="tex2html1523" 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="tex2html1524" HREF="../man/psimage.html"><I><B>psimage</B></I></A><A NAME="25962"></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="25968"></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="img181.png" ALT="\includegraphics[width=0.9\textwidth]{scripts/example_19}"></DIV></TD></TR> </TABLE> </DIV> <P> <A NAME="25078"></A> <A NAME="25079"></A> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html4718" HREF="node143.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html4712" HREF="node123.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html4706" HREF="node141.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html4714" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html4716" HREF="node258.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html4719" HREF="node143.html">7.20 Custom plot symbols</A> <B> Up:</B> <A NAME="tex2html4713" HREF="node123.html">7. Creating GMT Graphics</A> <B> Previous:</B> <A NAME="tex2html4707" HREF="node141.html">7.18 Volumes and Spatial</A> <B> <A NAME="tex2html4715" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html4717" HREF="node258.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> Paul Wessel 2011-02-27 </ADDRESS> </BODY> </HTML>