How can I give different colors to each x, y and z coordinate points?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Deepesh Kumar Gupta
il 17 Apr 2022
Commentato: Deepesh Kumar Gupta
il 17 Apr 2022
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 Commenti
Risposta accettata
DGM
il 17 Apr 2022
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')
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Distribution Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!