How can I give different colors to each x, y and z coordinate points?
2 次查看(过去 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
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!