フィルターのクリア

3D plot origin shifting

20 ビュー (過去 30 日間)
Tasrif Ul
Tasrif Ul 2023 年 8 月 12 日
編集済み: Walter Roberson 2023 年 8 月 12 日
I am doing a 3D plot in matlab, the code automatically select the red mark postion as origin, but I want to use the green mark positon as origin. How can I do that?Tried using
set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin','ZAxisLocation', 'origin')
, but have not found any solution yet

回答 (1 件)

the cyclist
the cyclist 2023 年 8 月 12 日
編集済み: the cyclist 2023 年 8 月 12 日
By default, the axes will go from smaller to larger number, starting from the point "nearest" you, moving "away". It seems like you probably want to set both the XDir and YDir properties to reverse. That will change this
N = 17;
rng default
scatter3(rand(N,1),rand(N,1),rand(N,1))
to this
rng default
scatter3(rand(N,1),rand(N,1),rand(N,1))
set(gca,"XDir","reverse","YDir","reverse")
so that the origin is now in the "far" corner. But I'm not sure if this is what you mean, because on your plot it looks like YDir was already reversed, so maybe you knew about that already?
I think it is also possible you just want to use the view function to change the line of sight?

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by