Scatter3 appears to require categorical values

조회 수: 7 (최근 30일)
HW
HW 2019년 6월 22일
답변: Walter Roberson 2019년 6월 22일
I am trying to make a scatter3 plot using three vectors of double values. When I attempt this, Matlab gives the following error message:
Values plotted against x-axis must be categorical values. To create categorical values, use the CATEGORICAL function.
In addition to getting this error when I feed in arrays of my data, I see this error message when I put in values manually (i.e., not using a reference to a variable) and also when I try the following code from the scatter3 documentation:
z = linspace(0,4*pi,250);
x = 2*cos(z) + rand(1,250);
y = 2*sin(z) + rand(1,250);
scatter3(x,y,z,'filled')
I am using Matlab R2019a. Any suggestions?

채택된 답변

Walter Roberson
Walter Roberson 2019년 6월 22일
I predict that you are doing this on top of an existing axes that had categorical values on the x axes. You cannot mix categorical and non-categorical plots on the same axes.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by