Home | News | Documentation | Download

Jupyter JSVis Zoom Out in Log Space

jupyter

#1

Hi,

When using the JSVis in Jupyter with a Python 2 notebook I’ve run into an unexpected behavior with zoom with the mouse wheel. The zoom in works as expected (the scale moves an equal about on both the left and right, up and down), but when zooming out it appears that the higher valued side (right and up) moves faster than the lower valued side (the lower value side may not be changing at all). This feels odd and is not the same behavior as when using a linear scaling. I’ve attached a couple screenshots, but t doesn’t do it justice, I suggest you try to attached script yourself.

Is this a problem with ROOT or with some visualization system that ROOT is built upon? It makes it rather jarring when zooming in and out and I frequently find my self resting the zoom and then trying to zoom in again to the region of interest.

Initial image:


Zoomed in (two mouse wheel clicks):

Zoomed out (two mouse wheel clicks):

import numpy
import ROOT
ROOT.enableJSVis()
logBins = numpy.logspace(-2,1,num=200)
h = ROOT.TH2D("h","H",len(logBins)-1, logBins, len(logBins)-1, logBins)
for i in range(5000):
    h.Fill(numpy.fabs(ROOT.gRandom.Gaus()), ROOT.gRandom.Gaus())
canvas = ROOT.TCanvas("canvas","Canvas")
canvas.SetLogx()
canvas.SetLogy()
h.Draw("COLZ")
canvas.Draw()

Thanks


#3

Hi,

Yes, I can reproduce a problem.
It is connected with logx/logy scale on your histogram.
I will check it.

Regards,
Sergey


#4

Problem fixed now in JSROOT dev version.
Next week we will update JSROOT installation for Jupyter


#5

Hi Sergey,

thanks also for tackling this. More info here: TGraphPainter in Jupyter

Cheers,
D


#6

Thanks for the quick fix.


#7

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