jiversen / freezeColors

Use multiple colormaps per figure or axis in MATLAB.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

freezeColours(colorbar) incorrect scale for custom caxis

streth11 opened this issue · comments

Hi, firstly great package, really useful. I believe I have found a bug in the colorbar axis scale when custom caxis limits are chosen. I havent thourghly tested it but my code is as follows:

Firstly, i have a scatter dataset stacked on top of an image, the dataset i have set custom caxis limits on, but the colorbar scale for the image is present (but with the correct frozen map)

`
colormap parula
scatter(x_coord,y_coord,150,distance_color_val,'.')
caxis([1 60])

freezeColors
freezeColors(colorbar)

hold on
imh = imshow(flipud(IM));
axis('on', 'image');
hold off
uistack(imh, 'bottom')
set(gca,"YDir","normal")
freezeColors
`
image

this can be simply corrected by repeating caxis([1 60]) under the final freezeColors however i suspect this isnt intended behaviour.