Patch vertical line along z axis

2 ビュー (過去 30 日間)
Federica Di Lauro
Federica Di Lauro 2020 年 5 月 3 日
編集済み: Ameer Hamza 2020 年 5 月 3 日
I have been trying to use patch to draw colored lines along the axis.
The following code can correctly display the x and y axis, however it does not plot the z axis.
patch([0,1],[0,0],[0,0],'EdgeColor', 'red', 'LineWidth', 2);
patch([0,0],[0,1],[0,0],'EdgeColor', 'green', 'LineWidth', 2);
patch([0,0],[0,0],[0,1],'EdgeColor', 'blue', 'LineWidth', 2);
Given that I'm only changing what points to connect I can't understand why the first 2 instructions work, while the last one does not.

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 5 月 3 日
編集済み: Ameer Hamza 2020 年 5 月 3 日
I am not sure about the issue with patch() here, but it is not the correct tool to draw lines. It is mainly used for drawing surface patches. You can use line() function
view(3)
line([0,1],[0,0],[0,0],'Color', 'r', 'LineWidth', 2);
line([0,0],[0,1],[0,0],'Color', 'g', 'LineWidth', 2);
line([0,0],[0,0],[0,1],'Color', 'b', 'LineWidth', 2);

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by