Plot Single Point on 3D Graph (Error: Not enough input arguments)
169 ビュー (過去 30 日間)
古いコメントを表示
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!
0 件のコメント
採用された回答
Walter Roberson
2020 年 12 月 22 日
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.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!