130 :
TPave(x1, y1, x2, y2)
136 TAxis *zaxis = fH->GetZaxis();
137 fAxis.ImportAxisAttributes(zaxis);
138 if (
gPad->GetView()) SetBit(kHasView);
146 :
TPave(x1, y1, x2, y2)
153 if (
gPad->GetView()) SetBit(kHasView);
161 :
TPave(x1, y1, x2, y2)
166 fAxis.ImportAxisAttributes(ax);
167 if (
gPad->GetView()) SetBit(kHasView);
184 palette.TPaletteAxis::Copy(*
this);
194 orig.TPaletteAxis::Copy(*
this);
217 if (px > plxmax && px < plxmax + 30 && py >= plymax && py <= plymin)
return px - plxmax;
231 static Int_t kmode = 0;
234 if (kmode != 0 || px <= plxmax) {
251 static Int_t px1old, py1old, px2old, py2old;
274 if (
gROOT->IsEscaped()) {
290 if (ratio2 - ratio1 > 0.05) {
292 if (
fH->GetDimension() == 2) {
301 Double_t newmin = zmin + (zmax - zmin) * ratio1;
302 Double_t newmax = zmin + (zmax - zmin) * ratio2;
303 if (newmin < zmin)newmin =
fH->GetBinContent(
fH->GetMinimumBin());
304 if (newmax > zmax)newmax =
fH->GetBinContent(
fH->GetMaximumBin());
309 fH->SetMinimum(newmin);
310 fH->SetMaximum(newmax);
334 if (
fLog == 0)
return gPad->GetLogz();
369 static char info[64];
374 zmin =
fH->GetMinimum();
375 zmax =
fH->GetMaximum();
432 if (
fH) ndivz =
fH->GetContour();
433 if (ndivz == 0)
return 0;
435 Int_t theColor, color;
436 Double_t scale = ndivz / (wlmax - wlmin);
439 if (zc < wlmin) zc = wlmin;
444 return gStyle->GetColorPalette(theColor);
462 wmin =
fH->GetMinimum();
463 wmax =
fH->GetMaximum();
465 wmin =
fAxis.GetWmin();
466 wmax =
fAxis.GetWmax();
471 Bool_t kHorizontal =
false;
473 if ((wlmax - wlmin) <= 0) {
475 if (mz == 0) mz = 0.1;
492 if (
fH) ndivz =
fH->GetContour();
493 else ndivz = ncolors;
494 if (ndivz == 0)
return;
496 Int_t theColor, color;
498 if (
fH &&
fH->GetDimension() == 2) {
499 fAxis.ImportAxisAttributes(
fH->GetZaxis());
500 TString ztit =
fAxis.GetTitle();
501 if (ztit.
Index(
";")>0) {
507 if (
fH &&
fH->GetDimension() > 2) {
508 TString ztit =
fH->GetZaxis()->GetTitle();
510 if (ztit.
Index(
";")>0) {
516 TLatex *label =
nullptr;
517 TLine *
line =
nullptr;
520 TString opt(
fH->GetDrawOption());
522 label =
new TLatex();
533 Double_t scale = ndivz / (wlmax - wlmin);
534 Double_t dw = (wlmax - wlmin) / ndivz;
535 for (
Int_t i = 0; i < ndivz; i++) {
537 if (
fH) zc =
fH->GetContourLevel(i);
538 else zc = wlmin + i*dw;
542 if (w1 < wlmin) w1 = wlmin;
546 if (
fH) zc =
fH->GetContourLevel(i + 1);
547 else zc = wlmin + (i+1)*dw;
553 if (w2 <= wlmin)
continue;
585 if (i == 0 || (b1 - prevlab) > 1.5*lsize_user) {
594 if (
fH && (b2 - prevlab > 1.5*lsize_user)) {
606 if (
fH) ndiv =
fH->GetZaxis()->GetNdivisions();
607 else ndiv =
fAxis.GetNdiv();
608 Bool_t isOptimized = ndiv>0;
610 Int_t maxD = absDiv/1000000;
611 ndiv = absDiv%100 + maxD*1000000;
612 if (!isOptimized) ndiv = -ndiv;
614 char chopt[6] =
"S ";
616 strncat(chopt,
"+L", 3);
619 strncat(chopt,
"N", 2);
624 strncat(chopt,
"G", 2);
647 out <<
" palette->SetNdivisions(" <<
fH->GetZaxis()->GetNdivisions() <<
");\n";
650 out <<
" palette->SetLabelFont(" <<
fH->GetZaxis()->GetLabelFont() <<
");\n";
651 out <<
" palette->SetLabelOffset(" <<
fH->GetZaxis()->GetLabelOffset() <<
");\n";
652 out <<
" palette->SetLabelSize(" <<
fH->GetZaxis()->GetLabelSize() <<
");\n";
653 out <<
" palette->SetMaxDigits(" <<
fH->GetZaxis()->GetMaxDigits() <<
");\n";
654 out <<
" palette->SetTickLength(" <<
fH->GetZaxis()->GetTickLength() <<
");\n";
655 out <<
" palette->SetTitleOffset(" <<
fH->GetZaxis()->GetTitleOffset() <<
");\n";
656 out <<
" palette->SetTitleSize(" <<
fH->GetZaxis()->GetTitleSize() <<
");\n";
658 out <<
" palette->SetTitleFont(" <<
fH->GetZaxis()->GetTitleFont() <<
");\n";
659 out <<
" palette->SetTitle(\"" << TString(
fH->GetZaxis()->GetTitle()).ReplaceSpecialCppChars() <<
"\");\n";
673 gPad->SetView(
nullptr);
674 fH->GetZaxis()->SetRange(0, 0);
675 if (
fH->GetDimension() == 2) {
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Class to manage histogram axis.
Double_t fX1
X of 1st point.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Double_t fY2
Y of 2nd point.
Double_t fX2
X of 2nd point.
Double_t fY1
Y of 1st point.
static TString SavePrimitiveColor(Int_t ci)
TH1 is the base class of all histogram classes in ROOT.
@ kUserContour
User specified contour levels.
@ kIsZoomed
Bit set when zooming on Y axis.
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
virtual void PaintLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
Mother of all ROOT objects.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a box.
void Paint(Option_t *option="") override
Paint this box with its current attributes.
TGaxis fAxis
Palette axis.
TPaletteAxis & operator=(const TPaletteAxis &)
char * GetObjectInfo(Int_t px, Int_t py) const override
Returns string containing info about the object at position (px,py).
Int_t GetBinColor(Int_t i, Int_t j)
void Copy(TObject &palette) const override
Copy a Box.
TH1 * fH
! Pointer to parent histogram
Int_t fLog
Log option: 0 use Logz, 1 is linear, 2 is log.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Int_t GetValueColor(Double_t zc)
A TBox with a bordersize and a shadow option.
Double_t GetY2NDC() const
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Double_t GetX2NDC() const
TString GetSavePaveArgs(const char *extra_arg=nullptr, Bool_t save_option=kTRUE)
Returns arguments which should be used when saving primitive constructor Check if coordinates are ini...
void Copy(TObject &pave) const override
Copy this pave to pave.
virtual void SetName(const char *name="")
Double_t fX2NDC
X2 point in NDC coordinates.
Double_t GetY1NDC() const
Double_t fY2NDC
Y2 point in NDC coordinates.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a pave.
Double_t fX1NDC
X1 point in NDC coordinates.
Double_t fY1NDC
Y1 point in NDC coordinates.
Double_t GetX1NDC() const
const char * Data() const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
RVec< PromoteType< T > > abs(const RVec< T > &v)
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.