We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b7edb8 commit 452f3a9Copy full SHA for 452f3a9
cmap_picker.m
@@ -45,17 +45,17 @@
45
% Select colorbar from it
46
imshow(image)
47
rect = drawrectangle().Position;
48
-
49
captured_cbar = imcrop(image, rect);
50
-[h, w, ~] = size(captured_cbar);
51
+% Chose orientation along the largest dimension of rectangle
+[h, w, ~] = size(captured_cbar);
52
if h >= w
53
cmap = flipud(squeeze(mean(captured_cbar, 2))) / 256;
54
else
55
cmap = squeeze(mean(captured_cbar, 1)) / 256;
56
end
57
58
-% show it to be sure ti worked
+% Show the colormap in a colorbar to check it worked
59
colormap(cmap)
60
colorbar()
61
0 commit comments