That’s the thing, I was making plots for my last publication at the beginning of the month and it was fine. Last week I tried to make plots for a presentation and the PNG and JPG turned blue. This was a sudden problem that I’ve never experienced before with the same ROOT version.
I have the same problem when updated to root_v6.20.04 in MacOS Majave 10.14, and It can be solved temporarily in batch mode without showing the canvas when running the code:
(1) adding gROOT->SetBatch(1); // set to batch mode->do not display graphics
or (2) root -l -b yourcode.C
then maybe you create the canvas.png in batch mode.
if you want to show the canvas (the image actually) when running the code, please add the following code:
//c->SaveAs(“canvas.png”); //if you have set this name
// back to graphics mode
gROOT->SetBatch(0);
// create an image from image file
TImage *ps = TImage::Open(“canvas.png”); //refer to #include “TImage.h”
if (!ps)
{
printf(“No image found\n”);
return;
}
new TCanvas(“png”, “display image in canvas”, 200, 10, 400, 400);
ps->Draw(“xxx”);