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

8 visualizaciones (últimos 30 días)
Kelly
Kelly el 24 de Sept. de 2024
Respondida: Epsilon el 25 de Sept. de 2024
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 comentario
dpb
dpb el 24 de Sept. de 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...)

Iniciar sesión para comentar.

Respuestas (1)

Epsilon
Epsilon el 25 de Sept. de 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!

Categorías

Más información sobre Unit Conversions en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by