diff --git a/hist/histpainter/src/THistPainter.cxx b/hist/histpainter/src/THistPainter.cxx index 356ab7444141c3d4aca1d7ec3fed693b9a134228..1062f6fbf05867cbdcb5dcc6fb28aa906d89d3d1 100644 --- a/hist/histpainter/src/THistPainter.cxx +++ b/hist/histpainter/src/THistPainter.cxx @@ -238,7 +238,7 @@ using `TH1::GetOption`: | "LEGO3" | Draw a lego plot with hidden surface removal, like LEGO1 but the border lines of each lego-bar are not drawn.| | "LEGO4" | Draw a lego plot with hidden surface removal, like LEGO1 but without the shadow effect on each lego-bar.| | "TEXT" | Draw bin contents as text (format set via `gStyle->SetPaintTextFormat`).| -| "TEXTnn" | Draw bin contents as text at angle nn (0 < nn < 90). | +| "TEXTnn" | Draw bin contents as text at angle nn (0 < nn <= 90). | | "X+" | The X-axis is drawn on the top side of the plot. | | "Y+" | The Y-axis is drawn on the right side of the plot. | | "MIN0" | Set minimum value for the Y axis to 0, equivalent to gStyle->SetHistMinimumZero(). | @@ -1634,7 +1634,7 @@ By default the format `g` is used. This format can be redefined by calling `gStyle->SetPaintTextFormat()`. It is also possible to use `TEXTnn` in order to draw the text with -the angle `nn` (`0 < nn < 90`). +the angle `nn` (`0 < nn <= 90`). For 2D histograms the text is plotted in the center of each non empty cells. It is possible to plot empty cells by calling `gStyle->SetHistMinimumZero()` @@ -1689,9 +1689,8 @@ Begin_Macro(source) htext4->SetMarkerSize(1.8); htext5->SetMarkerSize(1.8); htext5->SetMarkerColor(kRed); - htext3->Draw("COL"); htext4->SetBarOffset(0.2); - htext4->Draw("TEXT SAME"); + htext4->Draw("COL TEXT SAME"); htext5->SetBarOffset(-0.2); htext5->Draw("TEXT SAME"); } @@ -2338,7 +2337,7 @@ The following options are supported: | "0" | When used with any COL options, the empty bins are not drawn.| | "TEXT" | Draw bin contents as text (format set via `gStyle->SetPaintTextFormat`).| | "TEXTN" | Draw bin names as text.| -| "TEXTnn" | Draw bin contents as text at angle nn (0 < nn < 90).| +| "TEXTnn" | Draw bin contents as text at angle nn (0 < nn <= 90).| | "L" | Draw the bins boundaries as lines. The lines attributes are the TGraphs ones.| | "P" | Draw the bins boundaries as markers. The markers attributes are the TGraphs ones.| | "F" | Draw the bins boundaries as filled polygons. The filled polygons attributes are the TGraphs ones.| @@ -4252,6 +4251,21 @@ Int_t THistPainter::MakeChopt(Option_t *choptin) Hoption.Hist = 1; } } + l = strstr(chopt,"TEXT"); + if (l) { + Int_t angle; + if (sscanf(&l[4],"%d",&angle) > 0) { + if (angle < 0) angle=0; + if (angle > 90) angle=90; + Hoption.Text = 1000+angle; + } else { + Hoption.Text = 1; + } + memcpy(l," ", 4); + l = strstr(chopt,"N"); + if (l && fH->InheritsFrom(TH2Poly::Class())) Hoption.Text += 3000; + Hoption.Scat = 0; + } l = strstr(chopt,"COLZ"); if (l) { memcpy(l," ",4); @@ -4284,21 +4298,6 @@ Int_t THistPainter::MakeChopt(Option_t *choptin) l = strstr(chopt,"AXIS"); if (l) { Hoption.Axis = 1; memcpy(l," ",4); } l = strstr(chopt,"AXIG"); if (l) { Hoption.Axis = 2; memcpy(l," ",4); } l = strstr(chopt,"SCAT"); if (l) { Hoption.Scat = 1; memcpy(l," ",4); } - l = strstr(chopt,"TEXT"); - if (l) { - Int_t angle; - if (sscanf(&l[4],"%d",&angle) > 0) { - if (angle < 0) angle=0; - if (angle > 90) angle=90; - Hoption.Text = 1000+angle; - } else { - Hoption.Text = 1; - } - memcpy(l," ", 4); - l = strstr(chopt,"N"); - if (l && fH->InheritsFrom(TH2Poly::Class())) Hoption.Text += 3000; - Hoption.Scat = 0; - } l = strstr(chopt,"POL"); if (l) { Hoption.System = kPOLAR; memcpy(l," ",3); } l = strstr(chopt,"CYL"); if (l) { Hoption.System = kCYLINDRICAL; memcpy(l," ",3); } l = strstr(chopt,"SPH"); if (l) { Hoption.System = kSPHERICAL; memcpy(l," ",3); }