Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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

Respuesta aceptada

DGM
DGM el 17 de Abr. de 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')

Más respuestas (0)

Categorías

Más información sobre Model Import en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by