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

ex17.rst 1.6 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
  1. .. _example_17:
  2. (17) Images clipped by coastlines
  3. ---------------------------------
  4. This example demonstrates how :doc:`coast </coast>`
  5. can be used to set up clip paths based on coastlines. This approach is
  6. well suited when different gridded data sets are to be merged on a plot
  7. using different CPTs. Merging the files themselves may
  8. not be doable since they may represent different data sets, as we show
  9. in this example. Here, we lay down a color map of the geoid field near
  10. India with :doc:`grdimage </grdimage>`, use
  11. :doc:`coast </coast>` to set up land clip paths, and
  12. then overlay topography from the ETOPO5 data set with another call to
  13. :doc:`grdimage </grdimage>`. We finally undo the
  14. clippath with a second call to :doc:`coast </coast>`
  15. with the option **-Q** (See the Figure :ref:`fig_ex17`):
  16. We also plot a color legend on top of the land. So here we basically
  17. have three layers of "paint" stacked on top of each other: the
  18. underlying geoid map, the land mask, and finally the color legend. This
  19. legend makes clear how :doc:`grd2cpt </grd2cpt>`
  20. distributed the colors over the range: they are not of equal length put
  21. are associated with equal amounts of area in the plot. Since the high
  22. amounts (in red) are not very prevalent, that color spans a long range.
  23. For this image it is appropriate to use the **-I** option in
  24. :doc:`colorbar </colorbar>` so the legend gets shaded,
  25. similar to the geoid grid. See :doc:`/cookbook/cpts` to learn more about
  26. CPTs and ways to draw color legends.
  27. .. literalinclude:: /_verbatim/ex17.txt
  28. :language: bash
  29. .. _fig_ex17:
  30. .. figure:: /_images/ex17.*
  31. :width: 500 px
  32. :align: center
  33. Clipping of images using coastlines
Tip!

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

Comments

Loading...