This macro demonstrates batch image mode of web canvas When enabled - several images converted into JSON before all together provided to headless browser to produce image files.
Let significantly increase performance. Important - disable batch mode for flushing remaining images
void save_batch()
{
auto c =
new TCanvas(
"canvas",
"Canvas with histogram");
auto h1 =
new TH1I(
"hist",
"Histogram with random data", 100, -5., 5);
h1->SetDirectory(
nullptr);
h1->FillRandom(
"gaus", 10000);
for (
int n = 0;
n < 100; ++
n) {
h1->FillRandom(
"gaus", 10000);
}
}
1-D histogram with an int per channel (see TH1 documentation)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
static void BatchImageMode(UInt_t n=100)
Configure batch image mode for web graphics.
- Author
- Sergey Linev
Definition in file save_batch.C.