MATLAB Answers


Set colorbar ticks after use of hsv2rgb

Asked by Cortexlab on 6 Jun 2014
Hi there,
I would like to change the ticks of a colorbar that has been previously converted from an hsv to a rgb image with the function hsv2rgb.
I have an image imHsv whose hue imHsv(:,:,1) ranges between 0 and 1 (more precisely between 0.1 and 0.9 because I want to exclude the red color)
then I converted it to an rgb image: imRgb=hsv2rgb(imHsv);
and plot it with figure; imagesc(imRgb)
now I would like to set the colorbar such that the 8 values (0.1 : 0.8/7. : 0.9) of the previous imHsv(:,:,1) corresponds to the eight values (-70:10:0) that should go on the colorbar ticks. What should I do?
Many thanks!


Sign in to comment.

0 Answers