Effacer les filtres
Effacer les filtres

How to keep logarithmic scaling constant between multiple graphs?

1 vue (au cours des 30 derniers jours)
Hylke Dijkstra
Hylke Dijkstra le 19 Jan 2023
Commenté : Hylke Dijkstra le 20 Jan 2023
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!

Réponse acceptée

Walter Roberson
Walter Roberson le 19 Jan 2023
You need to configure clim (previously called caxis) to be the same for the axes.
  1 commentaire
Hylke Dijkstra
Hylke Dijkstra le 20 Jan 2023
Thanks, for anyone wondering:
clim([10^-5 10^0])
After each graph does the job.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Colormaps dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by