1D histograms with alphanumeric labels.
A TH1 can have named bins that are filled with the method overload TH1::Fill(const char*, double)
{
const std::array
people{
"Jean",
"Pierre",
"Marie",
"Odile",
"Sebastien",
"Fons",
"Rene",
"Nicolas", "Xavier", "Greg", "Bjarne", "Anton", "Otto", "Eddy",
"Peter", "Pasha", "Philippe", "Suzanne", "Jeff", "Valery"};
int nBins = 3;
for (int i = 0; i < 5000; i++) {
}
auto *
c1 =
new TCanvas(
"c1",
"demo bin labels", 10, 10, 900, 500);
auto *
pt =
new TPaveText(0.7, 0.85, 0.98, 0.98,
"brNDC");
pt->
AddText(
"Use the axis Context Menu LabelsOption");
pt->
AddText(
" \"a\" to sort by alphabetic order");
pt->
AddText(
" \">\" to sort by decreasing values");
pt->
AddText(
" \"<\" to sort by increasing values");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
1-D histogram with a double per channel (see TH1 documentation)
A Pave (see TPave) with text, lines or/and boxes inside.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
Random number generator class based on M.
- Date
- November 2024
- Author
- Rene Brun
Definition in file hist004_TH1_labels.C.