Pad 2Png

Create a canvas and save as png.

Author: Valeriy Onuchin
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, February 25, 2020 at 02:11 AM.

In [1]:
TCanvas *c = new TCanvas;
TH1F *h = new TH1F("gaus", "gaus", 100, -5, 5);
h->FillRandom("gaus", 10000);
h->Draw();

gSystem->ProcessEvents();

TImage *img = TImage::Create();

img->FromPad(c);

img->WriteImage("canvas.png");

Draw all canvases

In [2]:
gROOT->GetListOfCanvases()->Draw()