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

8 次查看(过去 30 天)
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 个评论
dpb
dpb 2024-9-24
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...)

请先登录,再进行评论。

回答(1 个)

Epsilon
Epsilon 2024-9-25
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!

类别

Help CenterFile Exchange 中查找有关 Unit Conversions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by