Default python Notebooks with Root¶
The following page describes how to setup root with jupyter notebooks such that the default type of a cell is python. This is what we did above. The description is a bit outdated and repeats what we habe descripted in P1.0 but it referes to another setup with jupterlab-desktop which is no longer maintained.
In [1]:
import ROOT
In [2]:
%%cpp
cout <<"sdfsdfsd";
sdfsdfsd
In [ ]:
In [3]:
import numpy
import ROOT
In [4]:
%jsroot on
In [5]:
h = ROOT.TH1F("gauss","Example histogram",100,-4,4)
h.FillRandom("gaus")
In [6]:
c = ROOT.TCanvas("myCanvasName","The Canvas Title",800,600)
h.Draw()
In [7]:
c.Draw()
In [8]:
%%cpp
gauss->Fit("gaus", "S");
myCanvasName->Draw();
**************************************** Minimizer is Minuit2 / Migrad Chi2 = 65.0502 NDf = 82 Edm = 4.60684e-07 NCalls = 55 Constant = 157.425 +/- 2.76819 Mean = 0.0138321 +/- 0.0143799 Sigma = 1.00178 +/- 0.0104857 (limited)
In [10]:
%%js
element.txt("sdfsf")