How to assign a reference point in graph?
3 ビュー (過去 30 日間)
古いコメントを表示
LAKSHMANAN ADAIKKAPPAN
2016 年 4 月 6 日
編集済み: Walter Roberson
2016 年 4 月 7 日
how to assign reference point(0,0) at left top corner like following figure?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160247/image.png)
0 件のコメント
採用された回答
Walter Roberson
2016 年 4 月 6 日
plot(rand(1,30))
set(gca,'YDir', 'reverse')
3 件のコメント
Walter Roberson
2016 年 4 月 7 日
編集済み: Walter Roberson
2016 年 4 月 7 日
Certainly I have checked the output of the code. If you prefer to see the full 0 to 14 and 0 to 16, change the graph to use that, such as
plot(0:16, 14 * rand(1,17))
and you might want to set the axis location as well,
set(gca, 'ydir', 'reverse', 'xaxislocation', 'top')
This could be taken further to get rid of the tick marks but leave the tick labels. The ease of doing that would depend upon the MATLAB version being used.
その他の回答 (2 件)
Muhammad Usman Saleem
2016 年 4 月 6 日
編集済み: Muhammad Usman Saleem
2016 年 4 月 6 日
UPDATE 1:
may try this
plot(1:10)
box off
axes('xlim', [1 10], 'ylim', [1 10], 'color', 'none', 'YAxisLocation', 'right', 'XAxisLocation', 'top')
or may try this
t=0:0.1:10;
y=sin(t);
plot(t,y)
set(gca,'XAxisLocation','top','YAxisLocation','left','ydir','reverse');
3 件のコメント
Steven Lord
2016 年 4 月 6 日
plot(1:10, 1:10);
axis ij
Or if you have the handle of your axes object already, change its YDir property to 'reverse' as Walter showed.
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!