# Line attributes in lego1 & lego2

**URL:** <https://root-forum.cern.ch/t/line-attributes-in-lego1-lego2/16152>\
**Category:** ROOT\
**Created:** [May 27, 2013, 12:07pm UTC](https://root-forum.cern.ch/t/line-attributes-in-lego1-lego2/16152 "2013-05-27T12:07:02Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Zesp](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/b5ac83/32.png) [@Zesp](https://root-forum.cern.ch/u/Zesp)\
**Post date:** [May 30, 2013, 8:57am UTC](https://root-forum.cern.ch/t/line-attributes-in-lego1-lego2/16152/8 "2013-05-30T08:57:06Z")

</div>

[quote]Please note the “Draw bottom face” part of TPainter3dAlgorithms::LegoCartesian() should be further upgraded when THStack will correctly handle TH2 with negative data (see viewtopic.php?f=3&t=16569)[/quote]To make myself clear, the patch above perfectly works with negative valued TH2 (see below).  
The problem is with THStack only ([THStack & TH2 with negative values](https://root-forum.cern.ch/t/thstack-th2-with-negative-values/16161/1)).  
So the patch above deserves to be commited on its own (see the fixes it allows in the “before & after patch” archives in the previous post).

[code]{  
gStyle-\>SetHistMinimumZero(kTRUE) ;  
gStyle-\>SetTitleFontSize(0.10) ;

TH2D \* histo = new TH2D (“histo”,“histo”,3,-3.,3.,3,-3.,3.) ;  
histo-\>SetBinContent(1,1, 1.) ;  
histo-\>SetBinContent(1,2, 3.) ;  
histo-\>SetBinContent(1,3, 4.) ;  
histo-\>SetBinContent(2,1,-6.) ;  
histo-\>SetBinContent(2,2, 0.) ;  
histo-\>SetBinContent(2,3, 9.) ;  
histo-\>SetBinContent(3,1,-8.) ;  
histo-\>SetBinContent(3,2, 2.) ;  
histo-\>SetBinContent(3,3,-5.) ;  
histo-\>SetMinimum(-10.) ;  
histo-\>SetMaximum( 10.) ;  
histo-\>SetStats(kFALSE) ;  
histo-\>SetFillColor(kRed) ;  
histo-\>SetLineColor(kAzure+1) ;  
histo-\>SetLineStyle(2) ;  
histo-\>SetLineWidth(2) ;

THStack \* hstack = new THStack (“hstack”,“hstack”) ;  
hstack-\>Add(histo) ;  
hstack-\>SetMinimum(-10.) ;  
hstack-\>SetMaximum( 10.) ;

TCanvas \* canvas = new TCanvas (“canvas”) ;  
canvas-\>Divide(2,3) ;  
canvas-\>cd(1) ; gPad-\>SetTheta( 30.) ; gPad-\>SetPhi( 30.) ; histo-\>SetTitle(“lego, topview” ) ; histo-\>DrawClone(“lego ,fb”) ;  
canvas-\>cd(3) ; gPad-\>SetTheta( 30.) ; gPad-\>SetPhi( 30.) ; histo-\>SetTitle(“lego1, topview” ) ; histo-\>DrawClone(“lego1,fb”) ;  
canvas-\>cd(5) ; gPad-\>SetTheta( 30.) ; gPad-\>SetPhi( 30.) ; histo-\>SetTitle(“lego2, topview” ) ; histo-\>DrawClone(“lego2,fb”) ;  
canvas-\>cd(2) ; gPad-\>SetTheta(-30.) ; gPad-\>SetPhi(-30.) ; histo-\>SetTitle(“lego, bottomview” ) ; histo-\>DrawClone(“lego ,fb”) ;  
canvas-\>cd(4) ; gPad-\>SetTheta(-30.) ; gPad-\>SetPhi(-30.) ; histo-\>SetTitle(“lego1, bottomview”) ; histo-\>DrawClone(“lego1,fb”) ;  
canvas-\>cd(6) ; gPad-\>SetTheta(-30.) ; gPad-\>SetPhi(-30.) ; histo-\>SetTitle(“lego2, bottomview”) ; histo-\>DrawClone(“lego2,fb”) ;  
}  
[/code]  
Cheers,  
Z

 ![](https://root-forum.cern.ch/uploads/default/original/2X/4/4d21c90e8be27901bd1c8166686a54b98afeaa8a.png)

---

_[View the full topic](https://root-forum.cern.ch/t/line-attributes-in-lego1-lego2/16152)._
