{ "cells": [ { "cell_type": "markdown", "id": "64fd1b18", "metadata": {}, "source": [ "# pad2png\n", "Create a canvas and save as png.\n", "\n", "\n", "\n", "\n", "**Author:** Valeriy Onuchin \n", "This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, May 19, 2026 at 08:38 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "68e245d7", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:46.956047Z", "iopub.status.busy": "2026-05-19T20:38:46.955939Z", "iopub.status.idle": "2026-05-19T20:38:47.533513Z", "shell.execute_reply": "2026-05-19T20:38:47.532709Z" } }, "outputs": [], "source": [ "TCanvas *c = new TCanvas;\n", "TH1F *h = new TH1F(\"gaus\", \"gaus\", 100, -5, 5);\n", "h->FillRandom(\"gaus\", 10000);\n", "h->Draw();\n", "\n", "gSystem->ProcessEvents();\n", "\n", "TImage *img = TImage::Create();\n", "\n", "img->FromPad(c);\n", "\n", "img->WriteImage(\"canvas.png\");" ] }, { "cell_type": "markdown", "id": "962cf37e", "metadata": {}, "source": [ "Draw all canvases " ] }, { "cell_type": "code", "execution_count": 2, "id": "692b81b3", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:38:47.535290Z", "iopub.status.busy": "2026-05-19T20:38:47.535166Z", "iopub.status.idle": "2026-05-19T20:38:47.747687Z", "shell.execute_reply": "2026-05-19T20:38:47.746875Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "