highlighting point in 3D-graph

In a 3D-graph made with surf I like to highlight one point on the shown surface. I know (x,y,z) of that point, but that isn't a matrix, so surf does not accept it. Any tips how to do this?

7 件のコメント

Adam
Adam 2017 年 12 月 18 日
doc plot3
should allow you to plot a single point with a marker in 3d.
Weia Reinboud
Weia Reinboud 2017 年 12 月 18 日
That works, I tried that already, but the axes as defined by surf are ruined by plot3. plot3 makes them much wider, so the graph becomes a tiny thing within a big space.
Adam
Adam 2017 年 12 月 18 日
Axes settings can be controlled independently of plotting instructions.
If you use the raw plotting instruction, 'line', in this case even though it is just one point, too with all arguments as 'property', 'value' pairs it should not come with any side-effects that change the axes behaviour, e.g.
line( hAxes, 'XData', 3, 'YData', 4, 'ZData', 5, 'Marker', '*' );
Weia Reinboud
Weia Reinboud 2017 年 12 月 18 日
What is that hAxes meant to do, I get an error message.
Weia Reinboud
Weia Reinboud 2017 年 12 月 18 日
Leaving the hAxes out it now works. The asterisk is a bit small, that's all
Weia Reinboud
Weia Reinboud 2017 年 12 月 18 日
Thanks!
Adam
Adam 2017 年 12 月 18 日
編集済み: Adam 2017 年 12 月 18 日
Oh yeah, I always forget to explain that. hAxes is what I generally call an axes handle. You should get used to always giving an explicit axes handle to plotting instructions.
You can change the size of the marker and choose from different marker types too. The documentation gives you all the parameters you can change. I can't remember offhand - 'MarlerSize' maybe is the parameter name, but I can't remember what a sensible number is or what the default is.

サインインしてコメントする。

回答 (0 件)

カテゴリ

タグ

質問済み:

2017 年 12 月 18 日

編集済み:

2017 年 12 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by