필터 지우기
필터 지우기

Transparency of rectangle disappears when saving as fig?

조회 수: 6 (최근 30일)
Kathleen Hupfeld
Kathleen Hupfeld 2019년 7월 18일
댓글: Kathleen Hupfeld 2019년 7월 20일
I can't figure this one out from past posts:
I add a transparent rectangle (alpha=0.3) to my plot:
rectangle('Position',[135 0 30 0.2], 'FaceColor', [0.2000 0.8000 0 0.3])
Then I want to save as a .fig file for later data processing:
set(gcf,'units','normalized','outerposition',[0 0 1 1])
savefig([root_dir,subnum,'/03_TMS/04_EMG_SPs/03_Plots_Tables/Individual_Graphs/',trialName,'_stim',num2str(j),'.fig']);
However, savefig gets rid of my transparency. The examples I could find discussed how to deal with this when you want to keep a transparent background / save as a .png image. How can I save as a .fig file and keep my transparency?
  댓글 수: 2
Jan
Jan 2019년 7월 19일
Currently you showed only, how you save the file. A file does not contain transparent objects, but they appear transparently, when you open the file and create a new figure. So please add the code you use to open the figure. Does it set the renderer to painters implicitly? You need OpenGL for transparency.
Kathleen Hupfeld
Kathleen Hupfeld 2019년 7월 20일
Ah ok all good things to know, thank you for your input!! I was just using GUI to open the .fig files (i.e., file->open).
I ended up working around the problem by just making a lighter green rectangle first, then plotting the EMG signal I'm working with over top of that rectangle, so it doesn't matter that it won't reopen as transparent.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by