Axes objects order - multiple plot types
조회 수: 2 (최근 30일)
이전 댓글 표시
I'm trying to plot different axes objects in a particular order. I have multiple plots that are overlayed on top of one another as follows:
Fig2 = figure( 'Color', 'w', 'PaperPositionMode', 'auto', ...
'Units', 'inches', 'Position', [ 0.01 0.01 6.99 8.74 ] );
hold off;
cla;
hold on;
ax1 = gca;
h6 = imagesc( x, y, ( sqrt( K1.uamp' .^ 2 + K1.vamp' .^ 2 ) ) );
set( h6, 'alphadata', ~isnan( sqrt( K1.uamp' .^ 2 + K1.vamp' .^ 2 ) ) );
h7 = quiver( indx.x, indx.y, K1.uamp, K1.vamp, 1.5 );
set( h7, 'Color', 'black' );
h8 = plot( coast.x, coast.y, 'Color', [ 0.8 0.8 0.8 ] );
h9 = scatter( source.x, source.y, 70, 'm', 'fill', '^' );
axis equal;
set( ax1, 'Layer', 'top' );
xlim( [ -9 7 ] );
ylim( [ -9 7 ] );
xlabel( 'X (km)' );
ylabel( 'Y (km)' );
box on;
But for whatever reason the line plot object (h8) still overrides the scatterplot object (h9). I tried using:
h10 = get( ax1, 'Children' );
uistack( h10(1), 'top' );
How do I get the scatterplot to lie on top of the line plot?
Thanks
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!