Simon
Simon

Reputation: 3539

Display multiple axes on image plot

I have a large plot showing an image. Now, I want to diplay several small bar plots on top of that image, each having its own axes and positioned on a specified position on the image.

I already tried to just append more axes (with transparent background color) to the same figure. This basically works, but If I now zoom in or pan around the background image, the small axes stay on the same position relative to the figure, so they lose the relation to their position on the background image.

Does Matlab offer a better solution?

Upvotes: 1

Views: 285

Answers (1)

Andrey Rubshtein
Andrey Rubshtein

Reputation: 20915

I recommend drawing the bars using patch command.

For example:

 plot(rand(10));
 hold on;
 patch([1;1;2;2],[1;2;2;1],'r')

Upvotes: 1

Related Questions