I have a problem editing a colorbar in MATLAB. The color bar is drawn, and I want to add a block (dB) for a specific measurement on YTickLabels. This is done using the following commands:
cy = get(ch,'YTickLabel');
set(ch,'YTickLabel',[]);
set(ch,'YTickLabel',strcat(cy,{' dB'}));
But when I resize the shape, MATLAB redefines the intervals, and the result is repeated twice, for example:
10 dB, 20 dB, 30 dB, 10 dB, 20 dB, 30 dB instead of 10 dB, 20 dB, 30 dB.
How do I prevent MATLAB from overriding its Y-axis ticks so that it does not ruin my color bar?
source
share