I am using portable Octave 5.1.0 under Win 10. I mean to write a plot to png with transparent background.
Disclaimer: This question is similar to the two linked below. I opted asking the present different question since I am adding further relevant information (by the same token, question #2 below was not a dupe of #1).
This is what I found:
print(gcf,'-dpngalpha', 'myplot.png');
, suggested in Saving a plot in Octave with transparent background, does not work for me. It is remarkable that I did not find documentation on this option.This answer has a couple of issues for me: 1) for some unknown reason
convert
does nothing. 2) The requirement of an external package makes it cumbersome. For instance, I cannot simply send my Octave code to someone else for him to use it.Option
svgconvert
is the only official documentation I found. But it would not apply to a png, e.g.imwrite
seems to have the capability to write with transparency, but I couldn't find a way to transform a plot into and image suitable forimwrite
. (See also Matlab documentation). Perhaps this is a possible route...
Is there any option available in Octave?
Related: