plot subplots on one background image

1 回表示 (過去 30 日間)
Istvan
Istvan 2011 年 10 月 16 日
Hello,
I am wondering how I can have a picture (.jpg) as the background of a figure and then plot several subplots on top of this picture (I would set postitio and axis off to see both the plots and the background).
The problem is, it is easy to have several pictures drawn, for each subplot, but that is not what I need --- it must be several subplots on well defined positions of one background picture.
Thanks for any suggestions!
Istvan

採用された回答

Image Analyst
Image Analyst 2011 年 10 月 16 日
  2 件のコメント
Istvan
Istvan 2011 年 10 月 17 日
yes, this solves all problems. One can use subplot() in combination with this and the axis below is protected. Thanks a lot!
Walter Roberson
Walter Roberson 2011 年 10 月 17 日
No, the axis below is not protected using the code in that solution. If you read that solution carefully, it says to draw the subplots first and then to put in the background. It doesn't explain why.
If you subplot() a new plot in to place after drawing the background image using the solution, your background image will be deleted.
The solution is the same as what I described except that I spent more time on describing the reasons and less time on describing step-by-step.

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 10 月 16 日
You cannot do this using subplot(). subplot() always removes any axes that is underneath the portion of the figure that is to be imaged in to.
If you were to create the subplots first and then to draw the image, and push the image "below" the subplots, then you would not run in to the above subplot behavior.
Be sure to set the 'color' property of each subplot axis to 'none'.

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by