No shadow in lego1

Hi there,

Attached is a patch not to plot shadowed faces in lego1 (git diff).
It introduces the new option “noshadow” (see below)

{ TH2D * histo = new TH2D ("histo","histo", 20,-5.,5., 20,-5.,5.) ; histo->FillRandom("gaus",1000) ; histo->SetFillColor(kRed) ; histo->SetStats(kFALSE) ; TCanvas * canvas = new TCanvas ("canvas") ; canvas->Divide(2,1) ; canvas->cd(1) ; histo->Draw("lego1,fb") ; canvas->cd(2) ; histo->Draw("lego1,fb,noshadow") ; }Could this (or any better version (gStyle?)) be committed to the trunk?

Cheers,
Z
lego1_noshadow.tgz (1015 Bytes)


I think would be better to have another lego option … with a number.

[quote]I think would be better to have another lego option … with a number.[/quote]Or create the method TAttFill::SetFillShadowColor() since TColor::GetColorDark() depends on the palette used and may sometimes return weird colors (see below).

{ Int_t pal=53 ; gStyle->SetPalette(pal) ; TH2D * histo = new TH2D ("histo",TString::Format("palette = %d",pal), 20,-5.,5., 20,-5.,5.) ; histo->FillRandom("gaus",1000) ; histo->SetStats(kFALSE) ; histo->SetFillColor(TColor::GetColorDark(kRed)) ; TCanvas * canvas = new TCanvas ("canvas") ; histo->Draw("lego1,0,fb") ; canvas->SaveAs(TString::Format("palette_%02d.png",pal)) ; }
Cheers,
Z




I still believe a new option is easier. What you suggest will introduce a new attribute, a new mechanism…
Whereas LEGO3 (we have now LEGO, LEGO1, LEGO2), will simply be “like lego one without shadow”.
It would prefer you implement that.

As LEGO4 then since LEGO3 exists already

Lighter indeed :wink:
Cheers,
Z
THistPainter.cxx.2.diff (1.87 KB)

it seems you have not done the dif against the very latest trunk because when I apply your patch THistPainter does not compile.

Oops, sorry about that.
Attached’s the right file and below’s an example

{ TH2D * histo = new TH2D ("histo","histo",20,-5.,5.,20,-5.,5.) ; histo->FillRandom("gaus",1000) ; histo->SetStats(kFALSE) ; histo->SetFillColor(kRed) ; histo->SetLineColor(kBlack) ; TCanvas * canvas = new TCanvas ("canvas") ; canvas->Divide(2,3) ; canvas->cd(1) ; histo->SetTitle("lego ") ; histo->DrawClone("lego ,0,fb") ; canvas->cd(2) ; histo->SetTitle("lego1") ; histo->DrawClone("lego1,0,fb") ; canvas->cd(3) ; histo->SetTitle("lego2") ; histo->DrawClone("lego2,0,fb") ; canvas->cd(4) ; histo->SetTitle("lego3") ; histo->DrawClone("lego3,0,fb") ; canvas->cd(6) ; histo->SetTitle("lego4") ; histo->DrawClone("lego4,0,fb") ; }
Cheers,
Z
THistPainter.cxx.3.diff (1.94 KB)


it does not work for me. See the screen dump.


Ooops, sorry :frowning:
That one should work better.
Cheers,
Z
THistPainter.cxx.4.diff (2.44 KB)

Now in the trunk. I also modified the doc and the TH2 Editor.

Thanks Olivier.
Bye,
Z