Filter löschen
Filter löschen

How to keep logarithmic scaling constant between multiple graphs?

1 Ansicht (letzte 30 Tage)
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!

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 19 Jan. 2023
You need to configure clim (previously called caxis) to be the same for the axes.

Weitere Antworten (0)

Kategorien

Mehr zu Colormaps finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by