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 Comments

doc plot3
should allow you to plot a single point with a marker in 3d.
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.
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', '*' );
What is that hAxes meant to do, I get an error message.
Leaving the hAxes out it now works. The asterisk is a bit small, that's all
Adam
Adam on 18 Dec 2017
Edited: Adam on 18 Dec 2017
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.

Sign in to comment.

Answers (0)

Tags

Asked:

on 18 Dec 2017

Edited:

on 18 Dec 2017

Community Treasure Hunt

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

Start Hunting!