matlab - 制作颜色条刻度线标签上方和下方的字符串,删除刻度线 - Matlab
问题描述
我正在尝试为我的图表重现下面的颜色条。具体来说,我正在努力解决的是字符串颜色条轴标题(颜色条上方和下方),其余部分似乎都很好。
time_begin = [1981, 1, 1, 0,0,0];
time_end = [2010,12,31,23,0,0];
years = (time_begin(1):time_end(1))';
nyears = length(years);
TXx1 = randi(100, 288, 192, 30);
lat = rand(192, 1);
lon = rand(288, 1);
time = rand(30,1);
M = numel(lon);
N = numel(lat);
slope1 = zeros(M, N);
intercept1 = zeros(M, N);
T = numel(time);
x = ([ones(T, 1) years]);
for i = 1 : M
for j = 1 : N
y1 = squeeze(TXx1(i, j, :));
c = regress(y1, x);
intercept1(i, j) = c(1);
slope1(i, j) = c(2);
end
end
TXx2 = randi(100, 288, 192, 30);
slope2 = zeros(M, N);
intercept2 = zeros(M, N);
T = numel(time);
x = ([ones(T, 1) years]);
for i = 1 : M
for j = 1 : N
y2 = squeeze(TXx2(i, j, :));
c = regress(y2, x);
intercept2(i, j) = c(1);
slope2(i, j) = c(2);
end
end
figure()
set(gcf, 'color', 'w');
temp = [slope1(:) slope2(:)];
temp(temp == 0) = NaN;
[Q,Qc] = hist3(temp,'Nbins',[100 100],'CDataMode','auto');
Qx = cell2mat(Qc(1));
Qy = cell2mat(Qc(2));
Q = Q';
Q = Q./trapz(Qy,trapz(Qx,Q,2));
surf(Qx,Qy,Q,'FaceColor','interp','EdgeColor','none')
grid off
set(gca, 'Fontsize', 12, 'Fontweight', 'Bold'); %added
cmap = jet(500);
cmap(1,:) = [1,1,1];
colormap(cmap);
h=colorbar;
set(h,'position',[.91 .34 .031 .475]) %[xposition yposition width height].
set(get(h,'ylabel'),'string','Point density');
set(h,'XTickLabel',{'Low',' ',' ',' ',' ','High',});
view(0,90)
解决方案
推荐阅读
- python - Tensor("StatefulPartitionedCall_8:0) 并期望任何非张量类型,得到一个张量而不是异常
- python - Python 处理从字符串到字典的多个 set-cookie 标头
- html - HTML 页面加载一个完全空白的屏幕
- python - 相同大小的方形子图,没有相等的轴比或共享轴
- javascript - 在 React 中发送垃圾邮件按钮后使函数仅触发一次
- c# - 如何只运行管道 ToProperty 运算符 Source 不是 Null
- javascript - 单击外部类时,Jquery关闭模式不起作用
- c - 抑制 VS Code 中宏的错误突出显示
- javascript - 为什么我会收到此错误:未捕获的类型错误:无法读取 null 的属性 'classList'
- c# - 使用 0x (C#) 将十六进制字符串转换为 int32