recently in the paper using MATLAB to generate Height field, online search a lot, do a small sum of their own.
First, if you want to add colorbar to the resulting picture, there are two ways:
1: In the generated figure image of the menu bar : insert-colorbar, or click the upper shortcut area to add Colorbar, see the following figure:
2: The command line is written directly
Colorbar;
If you want to specify a location at random:
Colorbar (' position ', [0.95 0.1 0.04 0.8]);
The data in square brackets refer to the horizontal axis, ordinate, width, and height of the lower left corner of the Colorbar. You can try changing the data to see the change.
Second, sometimes the generated colorbar is not what we want, how to adjust the colorbar of the numerical range and position .
Here is a control method for the program statement :
1, set (A, ' Clim ', [0 1]);
2, Caxis ([0,1]);
Before Colorbar, you can set its upper and lower limits, usually the second method is simpler.
We can click Colorbar, right-click--Select Launch ColorMap editor, you can adjust the Colorbar range of values at random
So we want to let our colorbar size, length, position, width are arbitrary, this is also very simple.
Click Colorbar, right-click--Select Show Property Editor
click on each small rectangle in the location to let our colorbar position change randomly.
Even, we can click the Colorbar in the image
can drag and resize arbitrarily.