how to conver to 3d plot to 2d plot well?
71 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sierra
el 21 de Mayo de 2022
Respondida: Voss
el 21 de Mayo de 2022
i know how to convert to 3d to 2d plot
first, 3d plot has three axes but if you convert 3d to 2d, it only has two axes.
so what i'm asking is that how to conver to 3d plot to 2d plot with three infrmation(x,y,z)?
ex) i have longitude, latitude and altitude data. and i want to plot this data well with 2d plot
thanks!
0 comentarios
Respuesta aceptada
Voss
el 21 de Mayo de 2022
You could make a 2d plot of some kind whose color comes from the data in the 3rd dimension, e.g., a surface or a contour:
lat = -50:5:50;
long = -100:5:100;
altitude = 6000-sqrt(lat(:).^2+long.^2);
% first, a 3d scatter plot:
subplot(3,1,1)
[x,y] = meshgrid(long,lat);
scatter3(x(:),y(:),altitude(:));
xlabel('Longitude');
ylabel('Latitude');
zlabel('Altitude');
% second, a surface of the same data,
% colored according to altitude:
subplot(3,1,2)
surface(long,lat,altitude)
xlabel('Longitude');
ylabel('Latitude');
cb = colorbar();
cb.YLabel.String = 'Altitude';
% third, a filled contour of the same data,
% colored according to altitude:
subplot(3,1,3)
contourf(long,lat,altitude)
xlabel('Longitude');
ylabel('Latitude');
cb = colorbar();
cb.YLabel.String = 'Altitude';
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Scatter Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!