Issue with colormap using Matlab 2016b
Show older comments
When I try to run a process with Matlab-2016b specifying a desired color palette (in the specific case jet) the output always returns a grayscale map instead. Does anybody experienced a similar issue? Can somebody please give me some advices on how to fix this? Following the code I use to generate the maps:
imshow(WCnorm_theta) ;
set(gca,'YDir','reverse') ;
axis on square tight ;
box on ;
caxis([ 0 1 ]) ;
colormap jet;
colorbar('eastoutside') ;
xlabel('X, pixels') ;
ylabel('Y, pixels') ;
Answers (2)
Adam
on 17 Oct 2016
Use the specific object handle - e.g.
colormap( hAxes, 'jet' )
where hAxes is your axes handle.
1 Comment
Roberto Emanuele Rizzo
on 17 Oct 2016
Image Analyst
on 17 Oct 2016
Yes, I've seen this too (it broke my existing code). I called the Mathworks and the answer was that colormap() now requires you to pass in the handle of the axes that you want to apply it to. It no longer just works on the current axes.
colormap(gca, jet(256));
1 Comment
Roberto Emanuele Rizzo
on 17 Oct 2016
Categories
Find more on White in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!