{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Hsimple\n",
    " This program creates :\n",
    "   - a one dimensional histogram\n",
    "   - a two dimensional histogram\n",
    "   - a profile histogram\n",
    "   - a memory-resident ntuple\n",
    "\n",
    " These objects are filled with some random numbers and saved on a file.\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "**Author:** Wim Lavrijsen, Enric Tejedor  \n",
    "<i><small>This notebook tutorial was automatically generated with <a href= \"https://github.com/root-project/root/blob/master/documentation/doxygen/converttonotebook.py\">ROOTBOOK-izer</a> from the macro found in the ROOT repository  on Wednesday, March 03, 2021 at 09:41 AM.</small></i>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Welcome to JupyROOT 6.23/01\n"
     ]
    }
   ],
   "source": [
    "from ROOT import TCanvas, TFile, TProfile, TNtuple, TH1F, TH2F\n",
    "from ROOT import gROOT, gBenchmark, gRandom, gSystem\n",
    "import ctypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create a new canvas, and customize it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "c1 = TCanvas( 'c1', 'Dynamic Filling Example', 200, 10, 700, 500 )\n",
    "c1.SetFillColor( 42 )\n",
    "c1.GetFrame().SetFillColor( 21 )\n",
    "c1.GetFrame().SetBorderSize( 6 )\n",
    "c1.GetFrame().SetBorderMode( -1 )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create a new ROOT binary machine independent file.\n",
    "Note that this file may contain any kind of ROOT objects, histograms,\n",
    "pictures, graphics objects, detector geometries, tracks, events, etc..\n",
    "This file is now becoming the current directory."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "hfile = gROOT.FindObject( 'py-hsimple.root' )\n",
    "if hfile:\n",
    "   hfile.Close()\n",
    "hfile = TFile( 'py-hsimple.root', 'RECREATE', 'Demo ROOT file with histograms' )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create some histograms, a profile histogram and an ntuple"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "hpx    = TH1F( 'hpx', 'This is the px distribution', 100, -4, 4 )\n",
    "hpxpy  = TH2F( 'hpxpy', 'py vs px', 40, -4, 4, 40, -4, 4 )\n",
    "hprof  = TProfile( 'hprof', 'Profile of pz versus px', 100, -4, 4, 0, 20 )\n",
    "ntuple = TNtuple( 'ntuple', 'Demo ntuple', 'px:py:pz:random:i' )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Set canvas/frame attributes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "hpx.SetFillColor( 48 )\n",
    "\n",
    "gBenchmark.Start( 'hsimple' )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Initialize random number generator."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "gRandom.SetSeed()\n",
    "rannor, rndm = gRandom.Rannor, gRandom.Rndm"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For speed, bind and cache the Fill member functions,"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "histos = [ 'hpx', 'hpxpy', 'hprof', 'ntuple' ]\n",
    "for name in histos:\n",
    "   exec('%sFill = %s.Fill' % (name,name))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Fill histograms randomly."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "px_ref, py_ref = ctypes.c_double(), ctypes.c_double()\n",
    "kUPDATE = 1000\n",
    "for i in range( 25000 ):\n",
    " # Generate random values. Use ctypes to pass doubles by reference\n",
    "   rannor( px_ref, py_ref )\n",
    " # Retrieve the generated values\n",
    "   px = px_ref.value\n",
    "   py = py_ref.value\n",
    "   \n",
    "   pz = px*px + py*py\n",
    "   random = rndm(1)\n",
    "\n",
    " # Fill histograms.\n",
    "   hpx.Fill( px )\n",
    "   hpxpy.Fill( px, py )\n",
    "   hprof.Fill( px, pz )\n",
    "   ntuple.Fill( px, py, pz, random, i )\n",
    "\n",
    " # Update display every kUPDATE events.\n",
    "   if i and i%kUPDATE == 0:\n",
    "      if i == kUPDATE:\n",
    "         hpx.Draw()\n",
    "\n",
    "      c1.Modified()\n",
    "      c1.Update()\n",
    "\n",
    "      if gSystem.ProcessEvents():            # allow user interrupt\n",
    "         break"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Destroy member functions cache."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hsimple   : Real Time =   0.65 seconds Cpu Time =   0.23 seconds\n"
     ]
    }
   ],
   "source": [
    "for name in histos:\n",
    "   exec('del %sFill' % name)\n",
    "del histos\n",
    "\n",
    "gBenchmark.Show( 'hsimple' )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Save all objects in this file."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "hpx.SetFillColor( 0 )\n",
    "hfile.Write()\n",
    "hpx.SetFillColor( 48 )\n",
    "c1.Modified()\n",
    "c1.Update()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that the file is automatically closed when application terminates\n",
    "or when the file destructor is called."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Draw all canvases "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "<div id=\"root_plot_1614764470339\"\n",
       "     style=\"width: 696px; height: 472px\">\n",
       "</div>\n",
       "<script>\n",
       "if (typeof require !== 'undefined') {\n",
       "\n",
       "    // We are in jupyter notebooks, use require.js which should be configured already\n",
       "    require(['scripts/JSRoot.core'],\n",
       "        function(Core) {\n",
       "           display_root_plot_1614764470339(Core);\n",
       "        }\n",
       "    );\n",
       "\n",
       "} else if (typeof JSROOT !== 'undefined') {\n",
       "\n",
       "   // JSROOT already loaded, just use it\n",
       "   display_root_plot_1614764470339(JSROOT);\n",
       "\n",
       "} else {\n",
       "\n",
       "    // We are in jupyterlab without require.js, directly loading jsroot\n",
       "    // Jupyterlab might be installed in a different base_url so we need to know it.\n",
       "    try {\n",
       "        var base_url = JSON.parse(document.getElementById('jupyter-config-data').innerHTML).baseUrl;\n",
       "    } catch(_) {\n",
       "        var base_url = '/';\n",
       "    }\n",
       "\n",
       "    // Try loading a local version of requirejs and fallback to cdn if not possible.\n",
       "    script_load(base_url + 'static/scripts/JSRoot.core.js', script_success, function(){\n",
       "        console.error('Fail to load JSROOT locally, please check your jupyter_notebook_config.py file')\n",
       "        script_load('https://root.cern/js/5.9.0/scripts/JSRootCore.min.js', script_success, function(){\n",
       "            document.getElementById(\"root_plot_1614764470339\").innerHTML = \"Failed to load JSROOT\";\n",
       "        });\n",
       "    });\n",
       "}\n",
       "\n",
       "function script_load(src, on_load, on_error) {\n",
       "    var script = document.createElement('script');\n",
       "    script.src = src;\n",
       "    script.onload = on_load;\n",
       "    script.onerror = on_error;\n",
       "    document.head.appendChild(script);\n",
       "}\n",
       "\n",
       "function script_success() {\n",
       "   display_root_plot_1614764470339(JSROOT);\n",
       "}\n",
       "\n",
       "function display_root_plot_1614764470339(Core) {\n",
       "   var obj = Core.parse({\"_typename\":\"TCanvas\",\"fUniqueID\":0,\"fBits\":3342344,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":42,\"fFillStyle\":1001,\"fLeftMargin\":0.1,\"fRightMargin\":0.1,\"fBottomMargin\":0.1,\"fTopMargin\":0.1,\"fXfile\":2,\"fYfile\":2,\"fAfile\":1,\"fXstat\":0.99,\"fYstat\":0.99,\"fAstat\":2,\"fFrameFillColor\":0,\"fFrameLineColor\":1,\"fFrameFillStyle\":1001,\"fFrameLineStyle\":1,\"fFrameLineWidth\":1,\"fFrameBorderSize\":1,\"fFrameBorderMode\":0,\"fX1\":-5.00000007450581,\"fY1\":-108.412508077361,\"fX2\":5.00000007450581,\"fY2\":975.712508077361,\"fXtoAbsPixelk\":348.00005,\"fXtoPixelk\":348.00005,\"fXtoPixel\":69.5999989628791,\"fYtoAbsPixelk\":424.800047186661,\"fYtoPixelk\":424.800047186661,\"fYtoPixel\":-0.435374143172283,\"fUtoAbsPixelk\":5e-5,\"fUtoPixelk\":5e-5,\"fUtoPixel\":696,\"fVtoAbsPixelk\":472.00005,\"fVtoPixelk\":472,\"fVtoPixel\":-472,\"fAbsPixeltoXk\":-5.00000007450581,\"fPixeltoXk\":-5.00000007450581,\"fPixeltoX\":0.0143678163060512,\"fAbsPixeltoYk\":975.712508077361,\"fPixeltoYk\":-108.412508077361,\"fPixeltoY\":-2.29687503422611,\"fXlowNDC\":0,\"fYlowNDC\":0,\"fXUpNDC\":1,\"fYUpNDC\":1,\"fWNDC\":1,\"fHNDC\":1,\"fAbsXlowNDC\":0,\"fAbsYlowNDC\":0,\"fAbsWNDC\":1,\"fAbsHNDC\":1,\"fUxmin\":-4,\"fUymin\":0,\"fUxmax\":4,\"fUymax\":867.3,\"fTheta\":30,\"fPhi\":30,\"fAspectRatio\":0,\"fNumber\":0,\"fTickx\":0,\"fTicky\":0,\"fLogx\":0,\"fLogy\":0,\"fLogz\":0,\"fPadPaint\":0,\"fCrosshair\":0,\"fCrosshairPos\":0,\"fBorderSize\":2,\"fBorderMode\":0,\"fModified\":false,\"fGridx\":false,\"fGridy\":false,\"fAbsCoord\":false,\"fEditable\":true,\"fFixedAspectRatio\":false,\"fPrimitives\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TFrame\",\"fUniqueID\":0,\"fBits\":8,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":42,\"fFillStyle\":1001,\"fX1\":-4,\"fY1\":0,\"fX2\":4,\"fY2\":867.3,\"fBorderSize\":1,\"fBorderMode\":0},{\"_typename\":\"TH1F\",\"fUniqueID\":0,\"fBits\":8,\"fName\":\"hpx\",\"fTitle\":\"This is the px distribution\",\"fLineColor\":602,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":48,\"fFillStyle\":1001,\"fMarkerColor\":1,\"fMarkerStyle\":1,\"fMarkerSize\":1,\"fNcells\":102,\"fXaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"xaxis\",\"fTitle\":\"\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":100,\"fXmin\":-4,\"fXmax\":4,\"fXbins\":[],\"fFirst\":0,\"fLast\":0,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fYaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"yaxis\",\"fTitle\":\"\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":0,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":1,\"fXmin\":0,\"fXmax\":1,\"fXbins\":[],\"fFirst\":0,\"fLast\":0,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fZaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"zaxis\",\"fTitle\":\"\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":1,\"fXmin\":0,\"fXmax\":1,\"fXbins\":[],\"fFirst\":0,\"fLast\":0,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fBarOffset\":0,\"fBarWidth\":1000,\"fEntries\":25000,\"fTsumw\":24999,\"fTsumw2\":24999,\"fTsumwx\":-196.596798778883,\"fTsumwx2\":24903.9112975308,\"fMaximum\":-1111,\"fMinimum\":-1111,\"fNormFactor\":0,\"fContour\":[],\"fSumw2\":[],\"fOption\":\"\",\"fFunctions\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TPaveStats\",\"fUniqueID\":0,\"fBits\":9,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fX1\":2.8000002026558,\"fY1\":731.784385904437,\"fX2\":4.80000026226044,\"fY2\":905.24438461206,\"fX1NDC\":0.780000016093254,\"fY1NDC\":0.775000005960464,\"fX2NDC\":0.980000019073486,\"fY2NDC\":0.935000002384186,\"fBorderSize\":1,\"fInit\":1,\"fShadowColor\":1,\"fCornerRadius\":0,\"fOption\":\"brNDC\",\"fName\":\"stats\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":12,\"fTextColor\":1,\"fTextFont\":42,\"fLabel\":\"\",\"fLongest\":18,\"fMargin\":0.05,\"fLines\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"hpx\",\"fTextAngle\":0,\"fTextSize\":0.0368,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.0368000008165836},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Entries = 25000  \",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Mean  = -0.007864\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Std Dev   = 0.9981\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04}],\"opt\":[\"\",\"\",\"\",\"\"]},\"fOptFit\":0,\"fOptStat\":1111,\"fFitFormat\":\"5.4g\",\"fStatFormat\":\"6.4g\",\"fParent\":{\"$ref\":3}}],\"opt\":[\"brNDC\"]},\"fBufferSize\":0,\"fBuffer\":[],\"fBinStatErrOpt\":0,\"fStatOverflows\":2,\"fArray\":[1,0,1,0,0,0,1,2,4,3,6,9,7,13,18,12,15,16,18,34,42,47,50,76,89,107,122,127,156,181,205,235,282,280,368,370,410,451,507,540,580,579,643,645,691,740,746,797,806,787,744,826,791,782,798,729,700,683,719,607,602,543,526,460,461,397,368,345,263,232,240,196,171,182,143,125,93,69,66,60,42,40,34,25,27,29,16,13,10,9,3,1,3,1,2,1,2,1,0,1,0,0]},{\"_typename\":\"TPaveText\",\"fUniqueID\":0,\"fBits\":9,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":0,\"fX1\":-2.19051727402056,\"fY1\":904.141887180387,\"fX2\":2.19051727402056,\"fY2\":970.291888166098,\"fX1NDC\":0.280948275862069,\"fY1NDC\":0.933983055615829,\"fX2NDC\":0.719051724137931,\"fY2NDC\":0.995000004768372,\"fBorderSize\":0,\"fInit\":1,\"fShadowColor\":1,\"fCornerRadius\":0,\"fOption\":\"blNDC\",\"fName\":\"title\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":22,\"fTextColor\":1,\"fTextFont\":42,\"fLabel\":\"\",\"fLongest\":27,\"fMargin\":0.05,\"fLines\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"This is the px distribution\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.0518644079566002}],\"opt\":[\"\"]}},{\"_typename\":\"TStyle\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"Modern\",\"fTitle\":\"Modern Style\",\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":19,\"fFillStyle\":1001,\"fMarkerColor\":1,\"fMarkerStyle\":1,\"fMarkerSize\":1,\"fTextAngle\":0,\"fTextSize\":0.05,\"fTextAlign\":11,\"fTextColor\":1,\"fTextFont\":62,\"fXaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fYaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":0,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fZaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fBarWidth\":1,\"fBarOffset\":0,\"fColorModelPS\":0,\"fDrawBorder\":0,\"fOptLogx\":0,\"fOptLogy\":0,\"fOptLogz\":0,\"fOptDate\":0,\"fOptStat\":1111,\"fOptTitle\":1,\"fOptFile\":0,\"fOptFit\":0,\"fShowEventStatus\":0,\"fShowEditor\":0,\"fShowToolBar\":0,\"fNumberContours\":20,\"fAttDate\":{\"_typename\":\"TAttText\",\"fTextAngle\":0,\"fTextSize\":0.025,\"fTextAlign\":11,\"fTextColor\":1,\"fTextFont\":62},\"fDateX\":0.01,\"fDateY\":0.01,\"fEndErrorSize\":2,\"fErrorX\":0.5,\"fFuncColor\":2,\"fFuncStyle\":1,\"fFuncWidth\":2,\"fGridColor\":0,\"fGridStyle\":3,\"fGridWidth\":1,\"fLegendBorderSize\":1,\"fLegendFillColor\":0,\"fLegendFont\":42,\"fLegendTextSize\":0,\"fHatchesLineWidth\":1,\"fHatchesSpacing\":1,\"fFrameFillColor\":0,\"fFrameLineColor\":1,\"fFrameFillStyle\":1001,\"fFrameLineStyle\":1,\"fFrameLineWidth\":1,\"fFrameBorderSize\":1,\"fFrameBorderMode\":0,\"fHistFillColor\":0,\"fHistLineColor\":602,\"fHistFillStyle\":1001,\"fHistLineStyle\":1,\"fHistLineWidth\":1,\"fHistMinimumZero\":false,\"fHistTopMargin\":0.05,\"fCanvasPreferGL\":false,\"fCanvasColor\":0,\"fCanvasBorderSize\":2,\"fCanvasBorderMode\":0,\"fCanvasDefH\":500,\"fCanvasDefW\":700,\"fCanvasDefX\":10,\"fCanvasDefY\":10,\"fPadColor\":0,\"fPadBorderSize\":2,\"fPadBorderMode\":0,\"fPadBottomMargin\":0.1,\"fPadTopMargin\":0.1,\"fPadLeftMargin\":0.1,\"fPadRightMargin\":0.1,\"fPadGridX\":false,\"fPadGridY\":false,\"fPadTickX\":0,\"fPadTickY\":0,\"fPaperSizeX\":20,\"fPaperSizeY\":26,\"fScreenFactor\":1,\"fStatColor\":0,\"fStatTextColor\":1,\"fStatBorderSize\":1,\"fStatFont\":42,\"fStatFontSize\":0,\"fStatStyle\":1001,\"fStatFormat\":\"6.4g\",\"fStatX\":0.98,\"fStatY\":0.935,\"fStatW\":0.2,\"fStatH\":0.16,\"fStripDecimals\":true,\"fTitleAlign\":23,\"fTitleColor\":0,\"fTitleTextColor\":1,\"fTitleBorderSize\":0,\"fTitleFont\":42,\"fTitleFontSize\":0.05,\"fTitleStyle\":0,\"fTitleX\":0.5,\"fTitleY\":0.995,\"fTitleW\":0,\"fTitleH\":0,\"fLegoInnerR\":0.5,\"fLineStyle\":[\"\",\"  \",\" 12 12\",\" 4 8\",\" 12 16 4 16\",\" 20 12 4 12\",\" 20 12 4 12 4 12 4 12\",\" 20 20\",\" 20 12 4 12 4 12\",\" 80 20\",\" 80 40 4 40\",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \",\"  \"],\"fHeaderPS\":\"\",\"fTitlePS\":\"\",\"fFitFormat\":\"5.4g\",\"fPaintTextFormat\":\"g\",\"fLineScalePS\":3,\"fJoinLinePS\":0,\"fCapLinePS\":0,\"fTimeOffset\":788918400,\"fImageScaling\":1}],\"opt\":[\"\",\"\",\"blNDC\",\"\"]},\"fExecs\":null,\"fName\":\"c1\",\"fTitle\":\"Dynamic Filling Example\",\"fNumPaletteColor\":0,\"fNextPaletteColor\":0,\"fDISPLAY\":\"$DISPLAY\",\"fDoubleBuffer\":0,\"fRetained\":true,\"fXsizeUser\":0,\"fYsizeUser\":0,\"fXsizeReal\":20,\"fYsizeReal\":14.28571,\"fWindowTopX\":0,\"fWindowTopY\":0,\"fWindowWidth\":0,\"fWindowHeight\":0,\"fCw\":696,\"fCh\":472,\"fCatt\":{\"_typename\":\"TAttCanvas\",\"fXBetween\":2,\"fYBetween\":2,\"fTitleFromTop\":1.2,\"fXdate\":0.2,\"fYdate\":0.3,\"fAdate\":1},\"kMoveOpaque\":true,\"kResizeOpaque\":true,\"fHighLightColor\":2,\"fBatch\":true,\"kShowEventStatus\":false,\"kAutoExec\":true,\"kMenuBar\":true});\n",
       "   Core.settings.HandleKeys = false;\n",
       "   Core.draw(\"root_plot_1614764470339\", obj, \"\");\n",
       "}\n",
       "</script>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%jsroot on\n",
    "from ROOT import gROOT \n",
    "gROOT.GetListOfCanvases().Draw()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
