Different Style in same Canvas -> SetErrorX()

Dear support!

How can I draw two histograms with different styles into the same Canvas? In principle, I want to do

TCanvas *c = new TCanvas(“c”, “c”);
gStyle->SetErrorX(0.35); h1->Draw(“same, E2”);
gStyle->SetErrorX(0.); h2->Draw(“same, E1”);

(I hope from this snipped it became clear, what I want.) However, gStyle sets a global style, of course, which always influences BOTH histograms. Is there any possibility to draw into the same Canvas one histogram with x-error-bars and and another without? (I also already tried c->Update() after drawing the first histogram, but this doesn’t help…).

Thank you in advance!
Matthias

you should use an Exec object to set the style like in the attached example.
twopal.C (754 Bytes)