フィルターのクリア

How to keep logarithmic scaling constant between multiple graphs?

1 回表示 (過去 30 日間)
Hylke Dijkstra
Hylke Dijkstra 2023 年 1 月 19 日
コメント済み: Hylke Dijkstra 2023 年 1 月 20 日
Dear all,
For a research project I want to display a relatively large matrix (1435x1435) that has coefficients between 0 and 1. I want to do this using the mesh command. The code I am using is at follows:
figure('WindowState','maximized',...
'Colormap',flip(hot));
% Create axes
axes1 = axes;
hold(axes1,'on');
% Create mesh
graph=mesh(Y1995);
view(axes1,[73.6250000000001 76.6295541401274]);
grid(axes1,'on');
hold(axes1,'off');
% Set the remaining axes properties
set(axes1,'ColorScale','log','XTick',[1 1435],'YTick',[1 1435],'ZTick',...
[0.2 0.4 0.6 0.8 1.0]);
xlim([1 1435])
ylim([1 1435])
zlim([0 1])
figure('WindowState','maximized',...
'Colormap',flip(hot));
% Create axes
axes1 = axes;
hold(axes1,'on');
% Create mesh
graph=mesh(Y2009);
view(axes1,[73.6250000000001 76.6295541401274]);
grid(axes1,'on');
hold(axes1,'off');
% Set the remaining axes properties
set(axes1,'ColorScale','log','XTick',[1 1435],'YTick',[1 1435],'ZTick',...
[0.2 0.4 0.6 0.8 1.0]);
xlim([1 1435])
ylim([1 1435])
zlim([0 1])
Ideally I would want this for the period 1995-2009. However, the problem currently is that the log scaling I want to apply is different for each graph. Because the values of the elements in Y1995 are on average much smaller than those in Y2009, the log scaling applies differently to each graph. This means that the changes in the values of each element in the matrix seem much smaller than they actually are.
Is there a way to uniformly apply the log scaling to each graph? Right now my graph applies the log scaling individually to each graph, which means the picture the graphs paint is distorted (i.e. they cannot be uniformly compared).
Unfortunately the dataset is too large to be appended.
Thanks in advance!

採用された回答

Walter Roberson
Walter Roberson 2023 年 1 月 19 日
You need to configure clim (previously called caxis) to be the same for the axes.
  1 件のコメント
Hylke Dijkstra
Hylke Dijkstra 2023 年 1 月 20 日
Thanks, for anyone wondering:
clim([10^-5 10^0])
After each graph does the job.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by