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

168 vues (au cours des 30 derniers jours)
Sclay748
Sclay748 le 22 Déc 2020
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!

Réponse acceptée

Walter Roberson
Walter Roberson le 22 Déc 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.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by