I have a matrix 'C' and I want to display the data in 'C' as an image with scaled colors by using 'imagesc'.
However, I get two different plots whether I use 'hold on' before or after 'imagesc', as per the two following examples.
- Example 1
>> figure>> imagesc( C )>> hold on
- Example 2
>> figure>> hold on>> imagesc( C )
In Example 2, the image is flipped and inset so that it does not fill up the entire figure size. In Example 1, instead, it plots normally.
Why is MATLAB behaving differently when I use 'hold on' first?
Best Answer