I get an error Error in <TASImage::WriteImage>: no image loaded whenever I try saving a TCanvas as a .png image (.pdf works fine). Example with a super simple macro:
void plot(){
TCanvas *c = new TCanvas("","",800,800);
c->SaveAs("newplot.png");
c->SaveAs("newplot.pdf");
}
I get the following output:
root [1] .L plot.C
root [2] plot()
Error in <TASImage::WriteImage>: no image loaded
Info in <TCanvas::Print>: pdf file newplot.pdf has been created
So the .pdf is saved, .png throws an error.
Here are my portage (gentoo package manager) USE flags for root: sci-physics/root X davix examples fortran gdml gsl graphviz ldap minuit python python_single_target_python3_6 python_targets_python3_6 roofit ssl tbb threads tiff tmva unran xml -opengl -qt5
$ root -b
------------------------------------------------------------------
| Welcome to ROOT 6.19/01 https://root.cern |
| (c) 1995-2019, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for macosx64 on Oct 29 2019, 09:17:06 |
| From heads/master@v6-19-01-1840-g5e8c56b0cc |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0] .L plot.C
root [1] plot()
Info in <TCanvas::Print>: png file newplot.png has been created
Info in <TCanvas::Print>: pdf file newplot.pdf has been created
root [2]