Skip to content

Commit b30fc02

Browse files
committed
[Docs] Add a reference to the blocking Draw to TH1's Python docs.
1 parent ddf1172 commit b30fc02

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • bindings/pyroot/pythonizations/python/ROOT/_pythonization

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_th1.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111
r"""
1212
\pythondoc TH1
1313
14+
## Drawing histograms in Python
15+
16+
Drawing histograms is done via TH1::Draw(). Note that in interactive scripts,TCanvas::Draw() can be
17+
made blocking to interactively show it on the screen before continuing execution.
18+
\code{.py}
19+
c = ROOT.TCanvas()
20+
h = ROOT.TH1D("h1", "h1", 100, -5, 5)
21+
h.FillRandom("gaus", 10000)
22+
h.Draw("")
23+
24+
c.Draw(block=True)
25+
\endcode
26+
1427
## Fitting histograms in Python
1528
1629
One-dimensional histograms can be fit in [Python](https://root.cern/manual/python) with a similar syntax as in C++.

0 commit comments

Comments
 (0)