필터 지우기
필터 지우기

how to make an image over some background picture?

조회 수: 2 (최근 30일)
Mark Golberg
Mark Golberg 2016년 2월 7일
댓글: Mark Golberg 2016년 2월 10일
Hello,
I am gradually drawing an image on axes (creating the effect of image "slides in"), using
set(gca,'xlim',[0 120*fps],'ylim',[0 25],'nextplot','add','ydir','reverse');
Question is, the default background is a a simple white plane. How can I change it to my own picture?
I mean, if I place my picture on that axes, then the xlim and ylim becomes the size of the picture and I loose the settings I've made in an earlier command.
THANK YOU

채택된 답변

Mayank Dwivedi
Mayank Dwivedi 2016년 2월 9일
Hi Mark,
The link below describes how to add an image to the axis:
The answer mentioned in the link above plots an axis then uses a custom image as it's background. This axes is then made invisible and to plot again a new axes is used.
When you plot again, the new axis will also have a white background. To make the axis transparent and make the background picture visible you need to set the axis 'Color' property to 'None' after you have plotted the data. For example, after making the first axis invisible as described in the link above you do the following to plot the data with background image visible-
>> set(ha,'handlevisibility','off', ...
'visible','off')
>> ha2 = axes('position',[0.3,0.35,0.4,0.4])
>> plot(rand(4))
>> set(gca, 'Color', 'None')
You can try implementing the "slide in" effect as you mentioned with the new axis. If you still face the issue please share the script that you are using.
Thanks,
Mayank

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by