필터 지우기
필터 지우기

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

조회 수: 153 (최근 30일)
Sclay748
Sclay748 2020년 12월 22일
답변: Walter Roberson 2020년 12월 22일
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!

채택된 답변

Walter Roberson
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개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by