Plot Single Point on 3D Graph (Error: Not enough input arguments)

177 visualizaciones (últimos 30 días)
Hello, I have a 3D graph already plotted. I am just trying to plot a point among the data I already have plotted. I keep getting error: Not enough input arguments.
I have tried this two ways:
1)
hold on
plot3(388.06, 153.35, 163.66,'+','k','MarkerSize',10);
2)
hold on
X = 388.06;
Y = 153.35;
Z = 163.66;
plot3(X,Y,Z,'+','k','MarkerSize',10);
Let me know if you know my error. Thanks!

Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Dic. de 2020
In context, '+' and 'k' are both examples of "linespec" . You can have at most one linespec for every group of points.
The easiest approach would be
plot3(X, Y, Z, '+k', 'MarkerSize', 10);
but you could also use
plot3(X, Y, Z, '+', 'Color', 'k', 'MarkerSize', 10);
Note that when you use name/value pairs, that all of them must come at the end of the call, and that they apply to all of the data triples, not just to the "nearest" data triple. So for example,
plot3(X, Y, Z, '+', X1, Y1, Z1, 'Color', 'k', 'MarkerSize', 10);
would apply the linespace '+' to X, Y, Z, and would apply the Color and MarkerSize to X, Y, Z as well, but X1, Y1, Z1 would use the default marker (because no linespec giving the marker and no 'Marker' name/value pair) but would use the Color and MarkerSize because those apply to all data.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by