how to make an image over some background picture?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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 Center 및 File Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!