Azzera filtri
Azzera filtri

Transparency in Matlab R2016b

1 visualizzazione (ultimi 30 giorni)
oliver
oliver il 5 Nov 2018
Modificato: oliver il 6 Nov 2018
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 Commento
oliver
oliver il 6 Nov 2018
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.

Accedi per commentare.

Risposte (1)

madhan ravi
madhan ravi il 5 Nov 2018
Modificato: madhan ravi il 6 Nov 2018
  2 Commenti
oliver
oliver il 6 Nov 2018
Modificato: oliver il 6 Nov 2018
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 il 6 Nov 2018
Modificato: oliver il 6 Nov 2018
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.

Accedi per commentare.

Prodotti


Release

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by