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

cpt_notes.rst_ 1.9 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
  1. Note on CPTs in Modern Mode
  2. ---------------------------
  3. In modern mode, CPTs are rarely needed to be named explicitly. Instead, when
  4. a module that may create a CPT, such as :doc:`grd2cpt` and :doc:`makecpt` (or even
  5. :doc:`grdimage` when no color table is available), the behavior under modern mode
  6. is to write that CPT to a hidden file in the session directory. When a module
  7. requires a CPT (e.g., **grdimage** not given **-C** or **plot** given **-C** with no name)
  8. then we read this hidden CPT (if it exists). This file is called the *current* CPT.
  9. In fact, there are several levels of current CPTs that may all be different, and
  10. some may not be present. If you create a CPT within an **inset** operation then
  11. that CPT is only accessible during the inset plotting; it thus only has the inset
  12. as its *scope*. If you create a CPT while positioned into a specific subplot, then
  13. that CPT is likewise only accessible to that subplot. If, on the other hand, you
  14. make a CPT after **subplot begin** but before any plotting then that CPT is
  15. available to all the subplots (but can be locally overridden by a subplot-specific
  16. CPT mention above). Finally, each call to **figure** means you may have a figure-specific
  17. CPT, should you create them. If none exists then the session CPT is used. The
  18. rule gmt follows is to always get the CPT with the most restricted scope that is visible from
  19. where you are in the plotting hierarchy. If not found we go up the hierarchy to CPTs
  20. with broader scope, and if none is ultimately found (and the module, unlike **grdimage**, cannot
  21. create a CPT by itself), then you have likely made a scripting error.
  22. There are cases in modern mode when you must explicitly create a named CPT using the
  23. **-H** option. One such case is when making movies with :doc:`movie` since you
  24. will want to create the CPT once and have **movie** access it again and again. Since
  25. each movie frame is a *separate session* there is no cross-session sharing of current
  26. CPTs.
Tip!

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

Comments

Loading...