1

I'm currently creating graphics usind the pgf backend for matplotlib. It works very well for integrating graphs generated in python in latex. However, transparency does not seem to be supported, even though I believe this should be possible in pgf. I am currently using version 1.5.1 of matplotlib.

Underdetermined
  • 419
  • 4
  • 9
  • Does the same plot show transparency when saved as `.png`? Are you using `savefig('figure.pgf', transparent=True)` to save? – mfitzp Jan 16 '16 at 15:21
  • @mfitzp Thanks for the quick response! I take it it should support transparency? I tried the keyword: no difference, trying to save as png gives me the error "RuntimeError: No suitable pdf to png renderer found." I'll look into why that is... – Underdetermined Jan 16 '16 at 15:28
  • Sorry, I have no idea whether it *should* (cant find a reference to it anywhere). The `.png` step was just a quick test to see if your plot is set up for transparency correctly. – mfitzp Jan 16 '16 at 15:35
  • well i looked at the error, downloaded a tool PDFtoCairo from http://blog.alivate.com.au/poppler-windows/ ( and can now save png using the pgf backend). However, the png is also not transparent... (when i use plt.show() it is). The name PDFtocairo though implies something pdf going on in the middle, which would not support transparency if i'm not mistaken. – Underdetermined Jan 16 '16 at 15:44
  • @mfitzp i'm sorry, i had a mistake the *.png is indeed transparent, and so is a *.pdf when I output that, but the *.pgf seems to be lacking transparency... – Underdetermined Jan 16 '16 at 16:00
  • This should probably go to the mpl mailing list. – tacaswell Jan 16 '16 at 17:26

1 Answers1

0

Yes. The .pgf backend does support transparency. If the *.png and *.pdf files come out as transparent, but the *.pgf does not than it may be a problem with your viewer, or tex packages.

For me it was the package "transparent" which enables transparent text on pictures, but I wasn't actually using, which clashed with pgf.

Underdetermined
  • 419
  • 4
  • 9