Skip to content

TGraph axis limits not set properly #379

@IFTClerk

Description

@IFTClerk

I noticed that some TGraph canvases are failing to draw properly when I updated my JSROOT version. The x axis limits are not automatically set to the correct range. If I do "unzoom" on the frame it fixes the drawing.

Drawn:
Image

Expected:
Image

I did a git bisect and it looks like the behaviour was changed in commit 435c3aea629f5912830eeffe57c8935638b67804. The reason seems to be that createHistogram() used to always be called with set_x and set_y as True, which is no longer the case.

It seems like when the TGraph object is loaded, it creates the fHistogram object, but it doesn't set the correct axis limits. Since the object exists, jsroot does not try to create a new histogram, or set axis limits.

When I load the object in ROOT, the TH1F associated with the TGraph has the correct limits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions