I am trying to plot a graph with fixed xaxis
古いコメントを表示
I have 2 vectors:
w1=[85 89.25 93.5 97.75 102 106.25 110.5 114.75 119 123.25 127.5 131.75 136 140.25 144.5 148.75 153 157.25 161.5 165.75 136 119 102 85]
and
w2=[1.0126 1.0106 1.0085 1.0065 1.0044 0.9974 0.9903 0.9831 0.9844 0.9823 0.9802 0.978 0.9758 0.9736 0.9714 0.9762 0.9741 0.9719 0.9698 0.9782 0.9913 0.9979 1.0044 1.0126]
when i plot(w1,w2). i get a rounded plot and x axis ranges from 80 to 160 i am trying to fix the xaxis to plot each y value for corresponding x and make the xaxis not be a min to max axis.
I tried plot(w1,w2);axis([w1]) but got an error
??? Error using ==> axis>LocSetLimits at 234 Vector must have 4, 6, or 8 elements.
Error in ==> axis at 94 LocSetLimits(ax(j),cur_arg);
Can someone help me in plotting
回答 (1 件)
Image Analyst
2012 年 7 月 20 日
Well what's x and what's y? Is w1 x and w2 y? Or are they both y's and the x's are simply the index number?
Are you aware that you can use xlim() to set the min and max of the x axis?
xlim([0 500]); % Or whatever values you want.
カテゴリ
ヘルプ センター および File Exchange で Annotations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!