TGraphPainter in Jupyter


I’ve run into an issue with parsing of the TGraphPainter options that only appears when using the python ROOT bindings in Juypter notebook with the enableJSVis feature on. ROOT version 6.10/02.

It seems that the options are not parsed correctly and that the "PLC" option specifically is parsed twice, once with the intended meaning and secondly as the meaning of each letter individually. I’ve checked using the native ROOT interpreter, in python standalone and without the enableJSVis(), in all these cases the plot renders as expected.

import numpy                             
import ROOT

xValues = numpy.array([0,1,2,3,4,5,6,7,8,9], dtype=numpy.float64)                  
yValues1 = numpy.array([0,1,2,3,4,5,6,7,8,9], dtype=numpy.float64)
yValues2 = numpy.array([9,8,7,6,5,4,3,2,1,0], dtype=numpy.float64)                 
yValues3 = numpy.array([6,2,8,3,5,1,9,7,4,0], dtype=numpy.float64)                 

gr = ROOT.TMultiGraph()                  
gr.Add(ROOT.TGraph(len(xValues), xValues, yValues1))                               
gr.Add(ROOT.TGraph(len(xValues), xValues, yValues2))
gr.Add(ROOT.TGraph(len(xValues), xValues, yValues3))

canvas = ROOT.TCanvas("canvas","")       
gr.Draw("A L PLC")

This image shows that the "P" and "C" opions have been enabled:


@linev might have an idea about this.


Problem that JSROOT does not support very new TMultiGraph draw options - PFC, PLC and PMC.
If one omit them, result of ROOT and JSROOT should be very similar.
I will try to provide support for these options soon.



I fix problem in dev branch

Next week appropriate version will be provided for Jupyter


P.S. It tooks few more weeks, but now Jupyter Notebooks using JSROOT 5.3.0 version, where problem is solved.

1 Like

Hi Sergey,

thanks a lot!!
Just to add some more context: notebooks pick up the latest stable release of jsroot automatically. Therefore, as soon as a release will be cut, the notebooks will automatically pick it up.


1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.