3 of 3
added 62 characters in body
Rick T
  • 3.3k
  • 10
  • 54
  • 120

Printing / saving a plot as a png file with an alpha channel issue in Octave

How can I print / save a plot as a png file with an alpha channel?

I tried Saving a plot in Octave with a transparent background

I'm using Octave 4.2.2, Ubuntu 18.04 64bit, and graphics_toolkit fltk

t = [0:0.01:2*pi]; x = sin (t);
plot (t, x);
set(gcf, 'Position',  [10, 10, 500, 500]);
print(gcf,'-dpngalpha', 'myplot.png');

I get an error error: print: unknown device pngalpha error: called from print_parse_opts at line 265 column 5 print at line 316 column 8

Please note: Octave is on 5.2 and this issue has a work around below...

Rick T
  • 3.3k
  • 10
  • 54
  • 120