https://github.com/briochemc/cmap_picker

Pick the colormap from a colorbar in an image.

https://github.com/briochemc/cmap_picker

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.9%) to scientific vocabulary

Keywords

cbar cmap color colorbar colormap colorscheme contour contourf figure heatmap matlab matlab-image-processing-toolbox pcolor plot
Last synced: 5 months ago · JSON representation

Repository

Pick the colormap from a colorbar in an image.

Basic Info
  • Host: GitHub
  • Owner: briochemc
  • License: mit
  • Language: MATLAB
  • Default Branch: main
  • Homepage:
  • Size: 5.86 KB
Statistics
  • Stars: 6
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 3
Topics
cbar cmap color colorbar colormap colorscheme contour contourf figure heatmap matlab matlab-image-processing-toolbox pcolor plot
Created almost 4 years ago · Last pushed almost 4 years ago
Metadata Files
Readme License

README.md

cmap_picker

Pick the colormap from a colorbar in an image.

When you want to compare your results with someone else's, it can be hard to reproduce a map or a plot with a colormap that you don't have in your setup. This tool allows you to create a colormap that matches that of any figure. You just have to accurately select where the colorbar is on the image/figure.

Here's an example of extracting the colormap from an image with some of matplotlib's colormaps:

https://user-images.githubusercontent.com/4486578/162355888-9562e3ff-7cd8-4d4c-ba3c-0f1adeb351af.mov

(Note I'm not very precise in my selection, surely you can do better!)

To check if you got it right, a colorbar with your newly created colormap is shown on the right.

Requires the Image Processing Toolbox!

Usage

  1. Find an image with a colorbar you want (e.g., take a screenshot)

  2. Call cmap = cmap_picker(image_path) This will open a figure window with your image displayed in it. (Don't forget to edit image_path to be your image's path!)

  3. And draw a rectancgle with your mouse (click-and-drag)! A colormap will be built by averaging over the colorbar's "width" (depending on the orientation of your rectangle). And a colorbar will be added to the figure to show you the colormap you just created.

Example:

Try this command and select whichever colorbar you want!

matlab cmap = cmap_picker('https://matplotlib.org/stable/_images/sphx_glr_colormaps_001_2_0x.png');

You can then save the variable cmap or use it once, as you would anyother colormap!

View cmap_picker on File Exchange

Owner

  • Name: Benoît Pasquier
  • Login: briochemc
  • Kind: user
  • Location: Sydney, Australia
  • Company: UNSW

Research Associate at UNSW

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: 4 minutes
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • briochemc (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels