I need help adjusting the axis on a theta-S contour plot

8 visualizzazioni (ultimi 30 giorni)
I'm having a difficult time finding area where I can adjust the axis. When I plot the data they are clustered at the bottom making it difficult to see. I have tried adjusting these three sections but nothing has been working. Any suggestions? Thank you!
% Adjusting xdim and ydim for smaller scale
xdim = round((smax - smin) ./ 0.05 + 1); % Decrease increment to 0.05
ydim = round((thetamax - thetamin) + 1);
% Adjust contour levels (decrease the scale)
contour_levels = 20:5:37; % Change the range as needed $$$$PAY Attention
[c, h] = contour(si, thetai, dens, contour_levels, 'k'); % Contour lines
clabel(c, h, 'LabelSpacing', 100);
% Adjusting x and y axis limits for scaling
xlim([smin, smax]); % Set limits for x-axis
ylim([thetamin, thetamax]); % Set limits for y-axis
end
  1 Commento
dpb
dpb il 24 Set 2024
You forgot to attach the data and a working example so folks could see what you're talking about (and then try to do something about it...)

Accedi per commentare.

Risposte (1)

Epsilon
Epsilon il 25 Set 2024
Hi Kelly,
The attached data has an outlier value of Potential_Temperature_C as 65535 at the first index which is much bigger than the other values. This results in scaling up of the plot to accommodate that value.
Plot with all the values:
plot(MAST402HW02Data2.Salinity,MAST402HW02Data2.Potential_Temperature_C,'.','MarkerSize',10);
Plot skipping the first value:
plot(MAST402HW02Data2.Salinity(2:end),MAST402HW02Data2.Potential_Temperature_C(2:end),'.','MarkerSize',10)
Consider omitting the value or replacing it, hope this helps!

Categorie

Scopri di più su Unit Conversions in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by