Xiang
Xiang

Reputation: 103

How to place axes objects on top of a figure in MATLAB?

I'm now using MATLAB R2012b. I want to draw a grey rectangle together with the axes, and want the rectangle to be behind the axes. I tried

uistack(gca,'top');

but nothing happens.

In this article they mentioned that

However, it is possible to place axes objects on top of UIPANEL objects (which were introduced in MATLAB 7.0 (R14)).

So I think there should be some way to do that.

Upvotes: 2

Views: 3125

Answers (1)

Abhishek Thakur
Abhishek Thakur

Reputation: 17025

Try the following:-

set(gca, 'Layer', 'top')

Ref: Draw Matlab graphs with frame, ticks, on top of graph lines

Upvotes: 2

Related Questions