How can I give different colors to each x, y and z coordinate points?

3 次查看(过去 30 天)
i want to give diffrent colors to x ,y and z data , lets x data to be blue color, y to be green and z to be red .
I am attaching my code.
% x coordinate data
temp1=350:390;
% y coordinate data
rad1=.001:.001:.02;
% z coordinate data (for this i have attached PPDF.csv file.)
test = csvread('PPDF.csv');
% x=test(:,1);
% y=test(:,2);
% z=test(:,3);
[r, t] = meshgrid(rad1, temp1);
figure
scatter3(t(:), r(:), test(:),'filled')
colormap jet

采纳的回答

DGM
DGM 2022-4-17
You'll have to figure out how you want to rescale the data to fit standard data range for a color table, but you can do something like this:
% x coordinate data
temp1=350:390;
% y coordinate data
rad1=.001:.001:.02;
% z coordinate data (for this i have attached PPDF.csv file.)
test = csvread('PPDF.csv');
[r, t] = meshgrid(rad1, temp1);
% create some sort of color map
cmap = [rescale(test(:)),rescale(r(:)),rescale(t(:))];
scatter3(t(:), r(:), test(:),10,cmap,'filled')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Model Import 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by