Transparency in Matlab R2016b

1 次查看(过去 30 天)
oliver
oliver 2018-11-5
编辑: oliver 2018-11-6
I am on R2016b and cannot create PNGs with transparent background. I
  • have set figure background color to "transparent" in copy options and tried copy-pasting -> white background
  • same after doing set(gca/gcf,'color','none') -> results in a black bg in Matlab and in a white bg when pasted.
  • edited figure properties and changed figure color to HSV with 100% transparency -> white background
Is there any way to get transparency in Matlab?
  1 个评论
oliver
oliver 2018-11-6
the only way I managed so far is so print to epsc2, then open in Illustrator to remove the white rectangle which is the figure background, and export to PNG. But surely Matlab can handle this without needing an expensive 3rd party software or without me having to manually edit the eps file.

请先登录,再进行评论。

回答(1 个)

madhan ravi
madhan ravi 2018-11-5
编辑:madhan ravi 2018-11-6
  2 个评论
oliver
oliver 2018-11-6
编辑:oliver 2018-11-6
Thanks but I may need a little more than that. Do you mean
set(gcf,'alpha',0)
I tried this and get a white background (both with copy/paste and print to png command).
If I just do alpha(0.5) the transparency of the facecolor in my plot elements is changed but the background is still white, so no good.
oliver
oliver 2018-11-6
编辑:oliver 2018-11-6
You have just changed you answer from "alpha" to a link. This will make it very difficult for others to follow this exchange. If you want to paste a new answer, better do so in the form field below.
With respect to your new answer, I find it odd that a multi-$1000 software is incapable of producing a PNG with transparent background and asks users to manually edit EPS files or install a user contributed fix (as suggested in your link). If this is the only solution, why then do they have the "transparent background" in the figure copy options. Seems like a bug to me which has persisted through numerous releases now without being fixed.

请先登录,再进行评论。

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by