Discussion:
control colorbar in pcolor plot
(too old to reply)
mariya ferdousi
2018-06-28 10:30:22 UTC
Permalink
Hi everyone,

I'm plotting some contour map (x, y, z). In Maltab, using

pcolor(x, y, z);
shading interp;
colormap(flipud(gray(256)));
colorbar;


Now I want to control the colorbar range from -15 to -20. I tried by the command

set(gca, 'clim', [-15 -20]);
and

caxis([-15 -20]).
Both commands show the error

Error using matlab.graphics.axis.Axes/set
While setting property 'CLim' of class 'Axes':
Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf.


Any suggestions to solve this problem?
Soumya Mohan
2018-06-29 10:49:45 UTC
Permalink
Post by mariya ferdousi
Hi everyone,
I'm plotting some contour map (x, y, z). In Maltab, using
pcolor(x, y, z);
shading interp;
colormap(flipud(gray(256)));
colorbar;
Now I want to control the colorbar range from -15 to -20. I tried by the command
set(gca, 'clim', [-15 -20]);
and
caxis([-15 -20]).
Both commands show the error
Error using matlab.graphics.axis.Axes/set
Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf.
Any suggestions to solve this problem?
caxis([-15 -20]);
Soumya Mohan
2018-06-29 10:50:33 UTC
Permalink
Post by mariya ferdousi
Hi everyone,
I'm plotting some contour map (x, y, z). In Maltab, using
pcolor(x, y, z);
shading interp;
colormap(flipud(gray(256)));
colorbar;
Now I want to control the colorbar range from -15 to -20. I tried by the command
set(gca, 'clim', [-15 -20]);
and
caxis([-15 -20]).
Both commands show the error
Error using matlab.graphics.axis.Axes/set
Value must be a 1x2 vector of numeric type in which the second element is larger than the first and may be Inf.
Any suggestions to solve this problem?
caxis([-20 -15]);

Loading...