i have these plots and i want the x axis and y axis to look similar. I mean the interval needs to be same.
1 回表示 (過去 30 日間)
古いコメントを表示
the y axis varies with 0.05 intervals but the x axis is not the same. it is 0.1. i want y axis with o.1 interval without changing the graph
0 件のコメント
回答 (1 件)
Prajit T R
2018 年 3 月 20 日
Hi Pruthviraj
Try the following sample code to manually set the intervals for x and y axes as you desire.
x=0:0.1:1;
y1=-0.298*(x.^2)-0.001*x;
y2=-0.368*(x.^2)-0.001*x;
plot(x,y1)
hold on
plot(x,y2)
Min_x=0;
Max_x=1;
Min_y=-1;
Max_y=1;
xlim([Min,Max]);
set(gca,'XTick',[Min_x : 0.1 : Max_x]);
set(gca,'YTick',[Min_y : 0.1 : Max_y]);
hold off
I hope this helps.
Cheers
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!