Skip to content

Commit 5ce2e68

Browse files
committed
Add movie to ReadMe
1 parent 54219d7 commit 5ce2e68

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
11
# cmap_picker
2+
23
Pick a colormap from the colorbar in an image
4+
5+
Requires the Image Processing Toolbox!
6+
7+
## Usage
8+
9+
https://user-images.githubusercontent.com/4486578/162355888-9562e3ff-7cd8-4d4c-ba3c-0f1adeb351af.mov
10+
11+
1. Find an image with a colorbar you want (e.g., take a screenshot)
12+
13+
2. Call `cmap = cmap_picker(impath)`
14+
This will open a figure window with your image in it.
15+
16+
3. Draw a rectancgle with your mouse (click-and-drag)
17+
A colormap will be built by averaging over the colorbar's "width"
18+
(depending on the orientation of your rectangle).
19+
A colorbar will also be added next to the figure to show you the colormap
20+
you just made.
21+
22+
## Example:
23+
24+
Try this command and select whichever colorbar you want!
25+
26+
```matlab
27+
cmap = cmap_picker('https://matplotlib.org/stable/_images/sphx_glr_colormaps_001_2_0x.png');
28+
```
29+
30+
and select the colormap of your choice, which will be saved in the variable `cmap` above. You can then save it or use it as you would anyother colormap!
31+
32+
33+

0 commit comments

Comments
 (0)