Skip to content

Provide access to GMT native colormaps #381

Open

Description

@MarkWieczorek

As far as I can tell, it is currently not possible to make use of the native GMT colormaps outside of the pygmt routines. There are lot of reasons of why you might want to use these elsewhere. For example, you might want to plot colored x-y data in a matplotlib image and use the same colormap in an accompanying pygmt map.

Some of these colormaps (such as Fabio Crameri's) can be downloaded and installed separately. Nevertheless, it would be much more convenient if these colormaps were all included explicitly in pygmt (such as in a module cmap, for example).

Activity

  1. leouieda commented on Nov 28, 2019

    @leouieda
    Member

    Hi @MarkWieczorek this is a bit tricky right now since we don't really have access to the GMT colormaps in memory. It's not impossible but right now they are handled by GMT as a hidden file. I agree that it would be good to be able to use GMT and maptlotlib colormaps interchangeably. I'm focusing more on the foundations of the library than adding new features still but let's keep this as a requested feature.

  2. MarkWieczorek commented on Jan 16, 2020

    @MarkWieczorek
    ContributorAuthor

    Perhaps a bigger issue is that it is not possible to pipe a custom matplotlib colormap into pygmt. An easy way to do this would be to provide a function pygmt.cmap_to_cpt(), which could then be used by pygmt.makecpt()

  3. added this to the 0.4.0 milestone on Nov 22, 2020
  4. added
    help wanted
    on May 1, 2021
  5. modified the milestones: 0.4.0, 0.5.0 on Jun 1, 2021
  6. modified the milestones: 0.5.0, 0.6.0 on Sep 30, 2021
  7. modified the milestones: 0.6.0, 1.0.0 on Mar 1, 2022
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 requesthelp wanted

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions