Making patch and background transparent in pcolor plot

조회 수: 3 (최근 30일)
Marina
Marina 2019년 7월 10일
Hello,
I am creating maps of data using pcolor and vectors overlaid with Quiver. I need to have the land and the figure background transparent so these can be overlaid over other maps. I've been painting the land black and the using findobj to convert the black patch to transparent, but it ends up being white when I save the figure as a png. Any suggestions?
thanks for any help!
Marina
V=(0:0.05:1);
load('mycmap_oscar','mycmap_oscar')
fig = figure;
m_proj('mercator','longitudes',[-96,-77],'latitud',[1,20]);
hold on
m_pcolor(long,lati,speed); shading interp;
colormap(mycmap_oscar);
fig = m_quiver(long,lati,outstrct.u(idx_lon,idx_lat),outstrct.v(idx_lon,idx_lat),2,'k','LineWidth',0.7);
m_gshhs_h('patch',[0 0 0]); % searches for the GSHHS database in /m_map/private. Sets land to black.
m_grid('box','off', 'LineStyle','none','xticklabels',[],'yticklabels',[],'xtick',[],'ytick',[]);
caxis([0.01 0.7])
set(findobj(gcf,'FaceColor',[0 0 0]),'FaceAlpha',0,'FaceVertexAlphadata',0)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by