making the x-axis and y-axis fixed for all plots

조회 수: 54 (최근 30일)
MA
MA 2021년 10월 31일
댓글: MA 2021년 11월 3일
having the following set of plots in the attached image,and the attached file has the code I used for making the plots.
for comparison porpuses how can I fix the x-axis scale to be from [0 3*10^12] for all the plots and the y-axis to be from [100 3000]. I have tried xlim and ylim but they don't see to change anything. I have thought also of linkaxes but I am not sure how I can apply it here. if anyone has an advice?
thanks in advance.
  댓글 수: 1
KSSV
KSSV 2021년 10월 31일
xlim, ylim and axes should work for you. It depends on how you have used them. Show us your full code.

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

채택된 답변

dpb
dpb 2021년 10월 31일
If you use x/ylim before plotting and then use plot, the auto-scaling will still be in effect for the axis and plot as the high-level routine will change the limits to match the actual data.
Put the data on the axis first, then call plot. Or, use hold on first...
hAx=axes;
xlim([0 3E12]), ylim([100 300])
hold on
hL=plot(...);
  댓글 수: 1
MA
MA 2021년 11월 3일
thank you, it turned out tht I need to put them inside the loop I am using in plotting the graph.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by