From 41435b0230f4859f050dbc801ae17b466b19c680 Mon Sep 17 00:00:00 2001 From: VanyaBelyaev Date: Wed, 18 Dec 2024 13:52:45 +0100 Subject: [PATCH] gPad ? gPad --- ostap/core/core.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ostap/core/core.py b/ostap/core/core.py index 7a6d587f..b3462720 100644 --- a/ostap/core/core.py +++ b/ostap/core/core.py @@ -599,7 +599,8 @@ def _TO_draw_ ( obj , option = '', *args , **kwargs ) : groot = ROOT.ROOT.GetROOT () pad = groot.GetSelectedPad() - if not pad : pad = ROOT.gPad + padg = ROOT.TVirtualPad.Pad() + if not pad and padg : pad = padg if pad : if 'LogX' in kw : pad.SetLogx ( kw.pop ( 'LogX' ) ) if 'LogY' in kw : pad.SetLogy ( kw.pop ( 'LogY' ) ) @@ -622,12 +623,13 @@ def _TO_draw_ ( obj , option = '', *args , **kwargs ) : result = obj.Draw ( option , *args ) result = obj - - if pad and not ROOT.gPad : + + padg = ROOT.TVirtualPad.Pad() + if pad and not padg : c = pad.GetCanvas() if c : c.Update() - elif ROOT.gPad : - c = ROOT.gPad + elif padg : + c = padg if c : c.Update() return result