How do I change the color bar scale
166 views (last 30 days)
Show older comments
Bajdar Nouredine on 14 Oct 2021
I want to change the scale from [0,1] to [36,45]
%% Example data
x = (1.9:-0.01:0);
data = sin(x);
%% Shift the values towards the center, so you get a circle instead of an annulus.
rho = x-min(x);
%% Your meshgrid generation code.
theta = (0:360)*pi/180;
[th, r] = meshgrid(theta, rho);
[th1, r1] = meshgrid(theta, d1);
%% Plotting the values
repmat(data(:), 1, size(th,2)), ...
axis equal tight;
Voss on 14 Oct 2021
To set the colorbar scale to [36 45], add the following line at the end of your code:
This will turn the circle all red since data is all less than 36.
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!