필터 지우기
필터 지우기

How to keep logarithmic scaling constant between multiple graphs?

조회 수: 1 (최근 30일)
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by