|
| 1 | +# Contour maps |
| 2 | + |
| 3 | +We want to create two contour maps of the low order geoid using the Hammer equal area projection. |
| 4 | +Our gridded data file is called ``osu91a1f_16.nc`` and contains a global 1 by 1 gridded geoid |
| 5 | +(we will see how to make gridded files later). We would like to show one map centered on Greenwich |
| 6 | +and one centered on the dateline. Positive contours should be drawn with a solid pen and negative |
| 7 | +contours with a dashed pen. Annotations should occur for every 50 m contour level, and both contour |
| 8 | +maps should show the continents in light brown in the background. This is how it is done: |
| 9 | + |
| 10 | + |
| 11 | +\begin{examplefig}{} |
| 12 | +```julia |
| 13 | +using GMT |
| 14 | +GMT.resetGMT() # hide |
| 15 | + |
| 16 | +subplot(grid=(2,1), region=:global, autolabel=true, margins=0.5, |
| 17 | + title="Low Order Geoid", panel_size=(16,0), frame="lrtb", proj=:Hammer, figsize=16) |
| 18 | + gmtset(MAP_GRID_CROSS_SIZE_PRIMARY=0, FONT_ANNOT_PRIMARY=10, PS_CHAR_ENCODING="Standard+") |
| 19 | + coast(frame="afg", land=:lightbrown, water=:lightblue) |
| 20 | + grdcontour("@osu91a1f_16.nc", cont=10, annot=(int=50,labels=(font=7,)), labels=(dist=10,), |
| 21 | + range=(-1000,-1), pen=((contour=1,pen="thinnest,-"), (annot=1, pen="thin,-")), |
| 22 | + ticks=(gap=(0.25,0.05),labels="")) |
| 23 | + grdcontour("@osu91a1f_16.nc", cont=10, annot=(int=50,labels=(font=7,)), labels=(dist=10,), |
| 24 | + range=(-1,100), ticks=(gap=(0.25,0.05),labels="")) |
| 25 | + |
| 26 | + coast(frame="afg", land=:lightbrown, water=:lightblue, panel=(2,1)) |
| 27 | + grdcontour("@osu91a1f_16.nc", cont=10, annot=(int=50,labels=(font=7,)), labels=(dist=10,), |
| 28 | + range=(-1000,-1), pen=((contour=1,pen="thinnest,-"), (annot=1, pen="thin,-")), |
| 29 | + ticks=(gap=(0.25,0.05),)) |
| 30 | + grdcontour("@osu91a1f_16.nc", cont=10, annot=(int=50,labels=(font=7,)), labels=(dist=10,), |
| 31 | + range=(-1,1000), ticks=(gap=(0.25,0.05),)) |
| 32 | +subplot("show") |
| 33 | +``` |
| 34 | +\end{examplefig} |
| 35 | + |
| 36 | +The first command sets up a 2 by 1 subplot layout. The subplot determines the size of what map can fit so we use? |
| 37 | +when specifying map widths in the commands below. This initial setup is followed by two sequences of \myreflink{coast} |
| 38 | +\myreflink{grdcontour}, \myreflink{grdcontour}. They differ in that the first is centered on the dateline, |
| 39 | +while the second on Greenwich. We use the **range** option in grdcontour to select negative contours only and |
| 40 | +plot those with a dashed pen, then positive contours only and draw with a solid pen [Default]. The **ticks** option |
| 41 | +causes tick marks pointing in the downhill direction to be drawn on the innermost, closed contours. For the upper |
| 42 | +panel we also added - and + to the local lows and highs. The labeling of the two plots with a) and b) is |
| 43 | +automatically done by \myreflink{subplot}. |
0 commit comments