You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The CPTs distributed with GMT are dynamic. This means they have several special properties that modify the behavior of programs that use them. Dynamic CPTs comes in a few different flavors: Some CPTs were designed to behave differently across a <strong>hinge</strong> value (e.g., a CPT designed specifically for topographic relief may include a discontinuity in color across the coastline at z = 0), and when users select these CPTs they will be stretched to fit the user’s desired data range separately for each side of this <em>hard</em><strong>hinge</strong>. Basically, a hard hinge CPT is the juxtaposition of two different CPTs joined at the hinge and these sections are stretched independently.</p>
479
522
<p>In the figure bellow the top color bar is a dynamic master CPT (here, globe) with a hard hinge at sea level and a natural range from -10,000 to +10,000 meters. However, our data range is asymmetrical, going from -8,000 meter depths up to +3,000 meter elevations. Because of the hinge, the two sides of the CPT will be stretched separately to honor the desired range while utilizing the full color range.</p>
<p>There are many ways to turn a master CPT into a custom CPT that works for your particular data range. The tools <ahref="../..\documentation/modules/makecpt.html">makecpt</a> and <code>grd2cpt</code> allow several types of transformations to take place:</p>
502
545
<p>Examples of two user CPTs for the range -0.5 to 3 created from the same master. One (left) extracted a subset of the master before scaling while the other (right) used the entire range.</p>
<divclass="code-copy-outer-scaffold"><divclass="sourceCode cell-code" id="cb2"><preclass="sourceCode julia code-with-copy"><codeclass="sourceCode julia"><spanid="cb2-1"><ahref="#cb2-1" aria-hidden="true" tabindex="-1"></a><spanclass="im">using</span><spanclass="bu">GMT</span></span>
505
548
<spanid="cb2-2"><ahref="#cb2-2" aria-hidden="true" tabindex="-1"></a>ls <spanclass="op">=</span> [<spanclass="fl">3</span><spanclass="fl">2.9</span>; <spanclass="co"># Coordinates of 6 line segments connecting example CPTs</span></span>
<p>Things become a bit more complicated when we want to label the legend with names for certain intervals (like geological time periods in the example below). To accomplish that, one should currently do a hack and add the labels manually in the CGMTcpt fields <code>label</code> and <code>key</code>, and add the <code>equal_size</code> option to the colorbar command that draws the color legend. This option also makes all intervals in the legend of equal length, even it the numerical values are not equally spaced.</p>
550
593
<p>Normally, the name labels are plotted at the lower end of the intervals. But by adding a gap amount (even when zero) to the -L option, they are centered. The example below also shows how to annotate ranges using <code>equal_size=(range=true,)</code> (in which case no name labels should appear in the CPT), and how to switch the color bar around (by using a negative length).</p>
0 commit comments