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 comentarios

Adam
Adam el 18 de Dic. de 2017
doc plot3
should allow you to plot a single point with a marker in 3d.
Weia Reinboud
Weia Reinboud el 18 de Dic. de 2017
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 el 18 de Dic. de 2017
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 el 18 de Dic. de 2017
What is that hAxes meant to do, I get an error message.
Weia Reinboud
Weia Reinboud el 18 de Dic. de 2017
Leaving the hAxes out it now works. The asterisk is a bit small, that's all
Weia Reinboud
Weia Reinboud el 18 de Dic. de 2017
Thanks!
Adam
Adam el 18 de Dic. de 2017
Editada: Adam el 18 de Dic. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Etiquetas

Preguntada:

el 18 de Dic. de 2017

Editada:

el 18 de Dic. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by