matlab colorbar修改值
我设置colorbar为这个形式,但是他每个刻度之间却像图里的一样,是不等间距的。colorbar('YTick',...[1E-6,1E-5,1E-4,1E-3,1E-...
我设置colorbar为这个形式,但是他每个刻度之间却像图里的一样,是不等间距的。
colorbar('YTick',...
[1E-6,1E-5,1E-4,1E-3,1E-2,1E-1,...
1E-0])
如何才能变得等间距,并且刻度还是我要求设置的这个? 展开
colorbar('YTick',...
[1E-6,1E-5,1E-4,1E-3,1E-2,1E-1,...
1E-0])
如何才能变得等间距,并且刻度还是我要求设置的这个? 展开
展开全部
这要改变你原来表示颜色的数据
先讲原来要代表颜色的数据取以10为底的对数
log10()
然后用下面语句标注
colorbar('YTick',[-6,-5,-4,-3,-2,-1,-0],...
'YTickLabel',{'1E-6','1E-5','1E-4','1E-3',...
'1E-2','1E-1','1E0'});
实际上,数据取了对数之后标注的位置是 -6~0
只是用'YTickLabel',让其在对应位置显示需要的文本
先讲原来要代表颜色的数据取以10为底的对数
log10()
然后用下面语句标注
colorbar('YTick',[-6,-5,-4,-3,-2,-1,-0],...
'YTickLabel',{'1E-6','1E-5','1E-4','1E-3',...
'1E-2','1E-1','1E0'});
实际上,数据取了对数之后标注的位置是 -6~0
只是用'YTickLabel',让其在对应位置显示需要的文本
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
但是他们的colorbar不一致,无法进行直观的比较,该如何调整呢?
C=rand(5); %
Create random values between 0 and 1
p=pcolor(C)
colorbar
C= .25*rand(5) + .5; % Create random values between
.375 and .625 for
p=pcolor(C) %
colorbar
解决办法有两个:
1、set(a, 'CLim', [0
1]);
2、caxis([0,1]);
For example:
%
Plot # 1
figure(1);
a = axes;
C = rand(5); % Random values between 0
and 1 for Plot#1
p = pcolor(C);
set(a, 'CLim', [0 1]); % CLim property
is set for figure(1) before colobar
colorbar; % colorbar is set for
figure(1)
% Clears the workspace
clear all;
clc;
% Plot #
2
figure(2);
a = axes;
C = .25*rand(5) + .5; % Create random values
between .375 and .625 for Plot # 2
p =
pcolor(C);
set(a, 'CLim', [0 1]); % CLim property is set
for figure(2) before colobar
colorbar; % colorbar
is set for figure(2)
figure(1);
C = rand(5); % Random values between 0 and 1 for Plot#1
p =
pcolor(C);
caxis([0,1]);
colorbar
figure(2);
C = .25*rand(5) + .5; % Create random values between .375 and
.625 for Plot # 2
p = pcolor(C);
caxis([0,1]);
colorbar
C=rand(5); %
Create random values between 0 and 1
p=pcolor(C)
colorbar
C= .25*rand(5) + .5; % Create random values between
.375 and .625 for
p=pcolor(C) %
colorbar
解决办法有两个:
1、set(a, 'CLim', [0
1]);
2、caxis([0,1]);
For example:
%
Plot # 1
figure(1);
a = axes;
C = rand(5); % Random values between 0
and 1 for Plot#1
p = pcolor(C);
set(a, 'CLim', [0 1]); % CLim property
is set for figure(1) before colobar
colorbar; % colorbar is set for
figure(1)
% Clears the workspace
clear all;
clc;
% Plot #
2
figure(2);
a = axes;
C = .25*rand(5) + .5; % Create random values
between .375 and .625 for Plot # 2
p =
pcolor(C);
set(a, 'CLim', [0 1]); % CLim property is set
for figure(2) before colobar
colorbar; % colorbar
is set for figure(2)
figure(1);
C = rand(5); % Random values between 0 and 1 for Plot#1
p =
pcolor(C);
caxis([0,1]);
colorbar
figure(2);
C = .25*rand(5) + .5; % Create random values between .375 and
.625 for Plot # 2
p = pcolor(C);
caxis([0,1]);
colorbar
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询