0

I have a colorbar in a figure in Matlab. It ranges from 0 to 4. The colorbar appears like this: 0,0.5,1,1.5,2,1.5,2,2.5,3 so as shown the step value is 0.5. I want it to step 1 at a time so that it appears like this: 0,1,2,3,4

4

1 回答 1

3

以下几行应该做到这一点:

hcb=colorbar;
set(hcb,'YTick',0:4);
于 2013-04-24T05:46:42.307 回答