GetUmin(), GetUmax() show wrong results for the canvases with the log scale

#!/usr/bin/env python3
import ROOT

ROOT.gStyle.Reset()

canvas = ROOT.TCanvas()
canvas.SetGridx()
canvas.SetGridy()
frame = canvas.DrawFrame(0.1,0.1,10.,10.)
print("Minimum value on the X axis: ", canvas.GetUxmin())
print("Maximum value on the X axis: ", canvas.GetUxmax())
canvas.SetLogx()
frame.GetXaxis().SetRangeUser(0.1, 10.)
canvas.Modified()
canvas.Update()
print("Minimum value on the X axis: ", canvas.GetUxmin())
print("Maximum value on the X axis: ", canvas.GetUxmax())

Output:

Minimum value on the X axis:  0.1
Maximum value on the X axis:  10.0
Minimum value on the X axis:  -1.0
Maximum value on the X axis:  1.0

Hello @FoxWise,

thanks for reaching out!
As stated in the documentation, GetUxmin returns the logarithmic value if log scale is set.

Cheers,
Monica

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