GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pygmt.makecpt: Make GMT color palette tables · Issue #4560 · GenericMappingTools/pygmt

pygmt.makecpt: Make GMT color palette tables #4560

New issue
Copy link
New issue
Copy link
Closed
Closed
pygmt.makecpt: Make GMT color palette tables#4560
Copy link
Labels
feature requestNew feature wanted

Description

@seisman
seisman
opened on Apr 11, 2026
Issue body actions

This issue serves as the central place for discussing and tracking the implementation of the pygmt.makecpt function in PyGMT. The issue will be closed when the initial implementation is complete. Progress is tracked at PyGMT: Wrapping GMT modules.

Documentation

  • GMT: https://docs.generic-mapping-tools.org/dev/makecpt.html
  • GMT.jl: https://www.generic-mapping-tools.org/GMTjl_doc/documentation/modules/makecpt
  • PyGMT: https://www.pygmt.org/dev/api/generated/pygmt.makecpt.html

GMT Option Flags and Modifiers

☑️: Implemented; ⬜: To be implemented/discussed; Strikethrough: Won't implement.

  • -A [+a] (transparency): Set a constant level of transparency (0–100) for all color slices; append +a to also affect foreground, background, and NaN colors.
  • -C (cmap): Select the master CPT to use in the interpolation; supports all built-in GMT color tables.
  • -D [i|o] (background): Match the background and foreground colors to the colors for the lowest and highest z-values in the output CPT.
  • -E [nlevels]: Create a CPT from the data range of the input table by dividing into nlevels equidistant levels; requires a data table as standard input.
  • -F [R|r|h|c][+c[label|start[-]]] (color_model): Force output CPT to be written with a specific color model (RGB, HSV, CMYK); optionally append +c for categorical formatting.
  • -G zlo/zhi (truncate): Truncate the incoming CPT so that the lowest and highest z-levels are zlo and zhi.
  • -H (output): Write the CPT to standard output (i.e., to a named file set by output).
  • -I [c|z] (reverse): Reverse the sense of color progression, or reverse the z-values.
  • -M (overrule_bg): Overrule background, foreground, and NaN colors from the master CPT with the GMT configuration parameters.
  • -N (no_bg): Do not write out the background, foreground, and NaN-color fields.
  • -Q: log
  • -S
  • -T [min/max/inc[+b|l|n]|file|list] (series): Define the range of the new CPT.
  • -V: verbose
  • -W (categorical): Do not interpolate; pick output colors from the beginning of the master CPT.
  • -Ww (cyclic): Produce a wrapped (cyclic) color table that endlessly repeats its range.
  • -Z: continuous
  • --PAR=value: Use pygmt.config instead.
  • -bi
  • -di
  • -ho
  • -i

Notes on Input Formats

  • makecpt does not take a data table as input in the standard case; it reads and interpolates an existing master CPT.
  • The -E option (not yet implemented) would require a data table as input to determine the data range automatically.
  • By default, the generated CPT is saved as the current CPT of the session/figure/subplot/panel/inset hierarchy. Use output to write to a named .cpt file.
  • The categorical and cyclic parameters are mutually exclusive; passing both raises GMTParameterError.

Linked Pull Requests

  • Initial feature implementation – Wrap makecpt #329
  • Add categorical and cyclic parameters – Migrate test_figure_shift_origin to dvc #1133
  • Add output (-H) parameter to save CPT to file – Add static_earth_relief to grd2xyz tests #1737
  • Add transparency (-A) parameter – Add a package-level variable __gmt_version__ for development use #2362
  • Implement -E option for building CPT from a data table's actual range
  • Add a gallery or tutorial example specifically demonstrating makecpt with user-defined data ranges and custom color models

Related Issues and Discussions

  • pygmt.makecpt is called before any plot using a colorbar; the resulting CPT is automatically used by Figure.colorbar.
  • The series parameter accepts the output from pygmt.info's nearest_multiple option directly, enabling a seamless range-to-colormap workflow.
  • The truncate and reverse="z" parameters interact: reversal is applied before truncation, so series must match the reversed z-range.

Activity

  1. seisman
    added this to PyGMT: Wrapping GMT moduleson Apr 11, 2026
  2. seisman
    added
    feature requestNew feature wanted
    on Apr 11, 2026
  3. seisman
    closed this as completedon Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature wanted

    Type

    No type

    Projects

    • PyGMT: Wrapping GMT modules
      Status
      No status
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402792 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.