필터 지우기
필터 지우기

Extending specific y-axis values

조회 수: 19 (최근 30일)
HA
HA 2020년 9월 28일
댓글: John Hatrick 2023년 7월 28일
Hello,
I am currently plotting some ocean depth profiles and have been asked to extend the top couple of hundred meters. I was hoping that this just meant changing to a log scale, but it seems that I need to create a new 'y axis scale'. So is there a way to do this? Use say half the plot for the top 500 meters then the rest of the plot carries on to 5000 all linearly. Almost like the top half is zoomed in in regards to y and the bottom half in zoomed out. I know how odd this potentially sounds and I am not sure if this is possible.
Thank you,
Holly

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 9월 28일
It is not a supported feature, but you can make two axes and join them such that they appear to be one axes. For example
x = linspace(0, 7);
y = exp(x);
ax1 = axes('Position', [0.1 0.1 0.8 0.4]);
ax1.XLim = [0 7];
ax1.YLim = [0 20];
hold on;
plot(x, y);
ax2 = axes('Position', [0.1 0.5 0.8 0.4]);
ax2.XAxis.Visible = 'off';
ax2.YScale = 'log';
ax2.XLim = [0 7];
ax2.YLim = [20 1000];
hold on;
plot(x, y);
  댓글 수: 3
Ameer Hamza
Ameer Hamza 2020년 9월 28일
Yes, I don't see any reason that there will be an issue. Maybe you can try something similar and comment if there is some issue.
John Hatrick
John Hatrick 2023년 7월 28일
I used subplots instead, and it worked perfectly. Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by