Transparency of rectangle disappears when saving as fig?

4 次查看(过去 30 天)
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