Note on CPTs in Modern Mode
---------------------------

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