フィルターのクリア

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 Center および File ExchangeScatter Plots についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by