put a background map on bottom of a scatter3

2 views (last 30 days)
Rebecca
Rebecca on 3 Mar 2014
Edited: Rebecca on 3 Mar 2014
Both plots work individually, but not together. It looks like when I am assigning Zdata values to all the patches plotted from landareas.shp, some but not all of the objects are getting moved. I think it is a problem with 'Children' or hidden objects, or maybe I should use handlem or getm. Also map data is not being trimmed to the axes. Here's my code, where vectors plotted are aircraft locations in x,y,and z (lon,lat,pressure), and RH is the relative humidity measured along the flight track. Z axis flipped so that pressure decreases upward. Left, right, bottom, and top edges for the axis are computed earlier in the code based on range of track data.
h1 = scatter3(good_lon,good_lat,good_pres,20,RH,'Filled');
colormap(flipud(winter)), colorbar, hold on
h2 = scatter3(new_ob_lon,ob_lat,ob_pres,20,'k');
set(gca,'zdir','reverse'), set(h2,'MarkerEdgeColor','k')
xlabel('Longitude'), ylabel('Latitude'), zlabel('Pressure Level')
title(['Relative Humidity Along Flight Track' ob_flgt_num{1}(:)' ...
ob_msn_num{1}(:)' dtg] )
h3 = geoshow('landareas.shp','FaceColor', [0.5 1.0 0.5]);
axis([leftedge rightedge bottomedge topedge]);
hh = get(h3,'Children');
for i = 1:numel(hh)
zdata = ones(size(get(hh(i),'XData') ));
set(hh(i),'ZData',1200*zdata)
end
Removing the axis call sets almost all the objects to ZData of 1200, but then the plots is over the whole world and zooming in does not work.
<<
>>
>>

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!