How to put two separate scales on the same x-axis?

조회 수: 3 (최근 30일)
Stephen Bompastore
Stephen Bompastore 2022년 10월 23일
댓글: Walter Roberson 2023년 10월 26일
I would like to create a plot in MATLAB with two separate scales along the x axis. I need the negative x-axis to go from -15 to 0 and have intervals of 5 and the positive x-axis to go from 0 to 0.8 with intervals of 0.1. The plot needs to have the same x-axis as the image. Thank you.
  댓글 수: 2
Zachary
Zachary 2023년 10월 26일
I'm doing the same lab XD
Glad to see that an hour of searching MATLAB code led me to this.
Thanks Stephen! Good luck at UML
Walter Roberson
Walter Roberson 2023년 10월 26일
It is not so difficult to create two adjacent axes with different scales, in a way that looks like a single continuous axes.
The tricky bit comes if you want to be able to pan or zoom or use datatips.

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

답변 (1개)

William Rose
William Rose 2022년 10월 24일
  댓글 수: 1
William Rose
William Rose 2022년 10월 24일
편집: William Rose 2022년 10월 24일
@Stephen Bompastore, I did not read your quesiton carefully enough. I see that the quesiton which @dpb answered was different than what you are asking.
The info here should be adaptable to do what you want. THat site includes instructions for making the plot below:
I am confident that you can modify those instructions to make your plot.

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by