When an histogram is drawn with the option COLZ
, a palette is automatically drawn vertically on the right side of the plot. It is possible to move and resize this vertical palette as shown on the left plot. The right plot demonstrates that, when the width of the palette is larger than its height, the palette is automatically drawn horizontally.
{
auto c =
new TCanvas(
"",
"",0,0,1100,550);
auto h1 =
new TH2D(
"h1",
"h1",40,-4,4,40,-20,20);
auto h2 =
new TH2D(
"h2",
"h2",40,-4,4,40,-20,20);
float px, py;
for (int i = 0; i < 25000; i++) {
}
p1->SetRightMargin(0.15);
p2->SetBottomMargin(0.2);
h2->GetListOfFunctions()->Add(
palette2);
p2->cd(); h2->Draw(
"colz");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TRandom * gRandom
R__EXTERN TStyle * gStyle
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
TList * GetListOfFunctions() const
2-D histogram with a double per channel (see TH1 documentation)
void Add(TObject *obj) override
The most important graphics class in the ROOT system.
The palette painting class.
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
- Author
- Olivier Couet
Definition in file movepalette.C.