Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webgraphics: different behaviour wrt classic graphics with 2 canvases #15353

Open
1 task
dpiparo opened this issue Apr 26, 2024 · 5 comments
Open
1 task

Webgraphics: different behaviour wrt classic graphics with 2 canvases #15353

dpiparo opened this issue Apr 26, 2024 · 5 comments
Assignees
Labels

Comments

@dpiparo
Copy link
Member

dpiparo commented Apr 26, 2024

Check duplicate issues.

  • Checked for duplicates

Description

There is a difference in the behaviour of the 2 graphics backends, when drawing on 2 canvases an updated historgam.

Reproducer

TCanvas c1;
TH1F h("h","h", 64, -4,4);
h.FillRandom("gaus");
h.Draw();
TCanvas c2;
h.FillRandom("gaus",10000);
h.Draw();

Classic graphics: One histo with 5k entries and one with 15k entries
Web graphics: Two histos with 15k entries

ROOT version

master

Installation method

sources

Operating system

MacOS

Additional context

No response

@linev
Copy link
Member

linev commented Apr 26, 2024

It is time glitch between web canvas and normal canvas.
Web canvas requires some time to be started - and during this time one get histogram fill to the end.
If one do c1.SaveAs("c1.png") and c2.SaveAs("c2.png") one get expected values.

@dpiparo
Copy link
Member Author

dpiparo commented Apr 27, 2024

Thanks. Nevertheless the problem is there also if commands are run interactively, waiting seconds after the first canvas is drawn.

@linev
Copy link
Member

linev commented May 15, 2024

Problem is extra gPad->Modified() call when new TCanvas is created.

In the macro it marks first canvas always as modified. And at the end of macro execution both canvas are updated to latest histogram content. I create PR #15518 which fixes such bogus behavior. After PR merged one can do:

TCanvas c1;
TH1F h("h","h", 64, -4,4);
h.FillRandom("gaus");
h.Draw();
c1.Update(); // ensures histogram displayed as exists at this point
TCanvas c2;
h.FillRandom("gaus",10000);
h.Draw();

@dpiparo
Copy link
Member Author

dpiparo commented May 20, 2024

I do not understand what is going on. Both code snippets with the tip of the master show two identical histograms with 15k entries. The changes had no effect in either case it seems.

@linev
Copy link
Member

linev commented May 21, 2024

I checked again. With the master branch last macro produces two canvases - with 5000 and 15000 entries.

With the 6.32 ROOT code one have to add gPad = nullptr; before creating second canvas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants