How to shift x axis to origin?
古いコメントを表示
x= linspace(0,6*180,1000);
y1 = sind(x);
y2 = sind(x-120);
y3 = sind(x-240);
plot(x,y1,x,y2,x,y3)
ax = gca;
ax.XLim = [0 4*180]
ax.XTick = [0 180 2*180 3*180 4*180]
ax.XAxisLocation = 'origin';
THIS CODE IS NOT WORKING
5 件のコメント
Adam
2018 年 2 月 14 日
There's no point just saying something is 'not working' if you don't explain why. Both axes in that plot appear to be at the origin to me when I run the code.
Jos (10584)
2018 年 2 月 14 日
When I execute your code above in R2017b, I get the following error:
Undefined function or variable 'THIS'.
Jan
2018 年 2 月 14 日
@Jos: Did you copy and paste "THIS CODE IS NOT WORKING" also?
Ankit kumar
2018 年 2 月 14 日
Jos (10584)
2018 年 2 月 14 日
@jan: yep :p (silly joke, I'll admit it ...)
採用された回答
その他の回答 (1 件)
KSSV
2018 年 2 月 14 日
0 投票
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!