Combine scatter3 with a map plot?

조회 수: 3 (최근 30일)
HRmatlab
HRmatlab 2017년 12월 6일
답변: Chad Greene 2018년 5월 30일
I have flight data (Longitude, Latitude, Altitude, property_x) from an airborne experiment. The data is plotted and colored by property_x using the scatter3 function: scatter3(Longitude, Latitude, Altitude, point size, property_x); This works very well and produces the desired 3D plot and I can easily set the colorbar and its limits. However, I was trying to find a way to plot this over a specific geographical area map defined by the Longitude, Latitude limits. In other words, I want to the existing scatter3 plot to be over a map in the XY plane. I have not found a way to do this.
Alternatively, I generated the desired map and used plot3m to plot my data but plot3m does not use a colorbar and it's not easy to adjust the colors of the flight data.
Any help would be greatly appreciated. Thank you

답변 (1개)

Chad Greene
Chad Greene 2018년 5월 30일
You can do the coordinate transformation yourself and plot over a map pretty easily. First, make the base map just as if you were about to use plot3m. Then do this:
[x,y] = mfwdtran(lat,lon),
scatter3(x,y,z,30,c,'filled')

Community Treasure Hunt

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

Start Hunting!

Translated by