Axes objects order - multiple plot types

2 次查看(过去 30 天)
curoi
curoi 2013-5-10
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 个)

类别

Help CenterFile 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!

Translated by