Closed soykje closed 2 years ago
I haven't actually checked, but my guess is that the svg format simply does not support custom operators like SCREEN (or cairo is not aware of such support), so cairo can only "fake" it by precomputing the rendered overlay and saving it as a raster.
Actually, I was wrong: svg 1.2 does support these compositing operators, it's just a matter of setting the correct version on the svg... I'll fix that.
Thx a lot for your answers and your time @anntzer! If I understood correctly, this SVG version update would have to be done on lib side, and not through configuration?
Yes. I have now pushed a commit that should let you do savefig(..., metadata={"MaxVersion": "1.2"})
which should fix the problem for you. (You'll need to build from source yourself; I don't really have the time to release a new version right now, in particular due to unrelated problems with the Windows build.)
Thanks for pointing out the limitation!
Fantastic! I'll test this asap, thx again for your time :+1:
Closing as this is fixed as of master (unless that still doesn't work for you).
Hello :wave:
I'm getting started with Matplotlib, and working on some dataviz personal project. For this purpose I wanted to use specific operators, such as
SCREEN
, on drawn polygons.Result is fine, but I'm having an issue (?) when I want to save (using
plt.savefig()
) my figure to SVG format: without operator SVG output is just fine, but withSCREEN
operator (or others...) I get a wrapped PNG (inside a<image />
). Is this expected?As I said, I'm getting started with Matplotlib, custom backend and also Python (!), so maybe there is something I'm missing here, or doing wrong? Anyway, any help would be really great!
Thx in advance :pray:
Sample code (from actual local code):
Result of
mplcairo.get_versions()
: