136 fAxis.ImportAxisAttributes(zaxis);
163 fAxis.ImportAxisAttributes(ax);
181 palette.TPaletteAxis::Copy(*
this);
191 orig.TPaletteAxis::Copy(*
this);
214 if (px > plxmax && px < plxmax + 30 && py >= plymax &&
py <= plymin)
return px - plxmax;
228 static Int_t kmode = 0;
231 if (kmode != 0 || px <= plxmax) {
248 static Int_t px1old, py1old, px2old, py2old;
271 if (
gROOT->IsEscaped()) {
287 if (ratio2 - ratio1 > 0.05) {
289 if (
fH->GetDimension() == 2) {
292 if (
gPad->GetLogz()) {
298 Double_t newmin = zmin + (zmax - zmin) * ratio1;
299 Double_t newmax = zmin + (zmax - zmin) * ratio2;
300 if (newmin < zmin)newmin =
fH->GetBinContent(
fH->GetMinimumBin());
301 if (newmax > zmax)newmax =
fH->GetBinContent(
fH->GetMaximumBin());
302 if (
gPad->GetLogz()) {
306 fH->SetMinimum(newmin);
307 fH->SetMaximum(newmax);
351 static char info[64];
356 zmin =
fH->GetMinimum();
357 zmax =
fH->GetMaximum();
363 if (
gPad->GetLogz()) {
405 if (
gPad->GetLogz()) {
414 if (
fH) ndivz =
fH->GetContour();
415 if (ndivz == 0)
return 0;
417 Int_t theColor, color;
418 Double_t scale = ndivz / (wlmax - wlmin);
421 if (zc < wlmin) zc = wlmin;
423 color =
Int_t(0.01 + (zc - wlmin) * scale);
426 return gStyle->GetColorPalette(theColor);
453 Bool_t kHorizontal =
false;
455 if ((wlmax - wlmin) <= 0) {
457 if (mz == 0) mz = 0.1;
466 if (
gPad->GetLogz()) {
474 if (
fH) ndivz =
fH->GetContour();
475 else ndivz = ncolors;
476 if (ndivz == 0)
return;
478 Int_t theColor, color;
480 if (
fH &&
fH->GetDimension() == 2) {
481 fAxis.ImportAxisAttributes(
fH->GetZaxis());
483 if (ztit.
Index(
";")>0) {
489 if (
fH &&
fH->GetDimension() > 2) {
490 TString ztit =
fH->GetZaxis()->GetTitle();
492 if (ztit.
Index(
";")>0) {
510 line->SetLineColor(
fAxis.GetLineColor());
515 Double_t scale = ndivz / (wlmax - wlmin);
516 Double_t dw = (wlmax - wlmin) / ndivz;
519 if (
fH) zc =
fH->GetContourLevel(
i);
520 else zc = wlmin +
i*dw;
524 if (w1 < wlmin) w1 = wlmin;
528 if (
fH) zc =
fH->GetContourLevel(
i + 1);
529 else zc = wlmin + (
i+1)*dw;
535 if (w2 <= wlmin)
continue;
547 color =
Int_t(0.01 + (w1 - wlmin) * scale);
567 if (
i == 0 || (b1 - prevlab) > 1.5*lsize_user) {
572 if (kHorizontal)
line->PaintLine(b2,
ymin+tlength, b2,
ymin);
576 if (
fH && (b2 - prevlab > 1.5*lsize_user)) {
580 if (kHorizontal)
line->PaintLine(b1,
ymin+tlength, b1,
ymin);
588 if (
fH) ndiv =
fH->GetZaxis()->GetNdivisions();
589 else ndiv =
fAxis.GetNdiv();
590 Bool_t isOptimized = ndiv>0;
591 Int_t absDiv = abs(ndiv);
592 Int_t maxD = absDiv/1000000;
593 ndiv = absDiv%100 + maxD*1000000;
594 if (!isOptimized) ndiv = -ndiv;
596 char chopt[6] =
"S ";
598 strncat(chopt,
"+L", 3);
601 strncat(chopt,
"N", 2);
603 if (
gPad->GetLogz()) {
606 strncat(chopt,
"G", 2);
629 out <<
" " << std::endl;
637 <<
"," <<
fH->GetName() <<
");" << std::endl;
640 <<
"," <<
fH->GetName() <<
");" << std::endl;
642 out <<
" palette->SetNdivisions(" <<
fH->GetZaxis()->GetNdivisions() <<
");" << std::endl;
643 out <<
" palette->SetAxisColor(" <<
fH->GetZaxis()->GetAxisColor() <<
");" << std::endl;
644 out <<
" palette->SetLabelColor(" <<
fH->GetZaxis()->GetLabelColor() <<
");" << std::endl;
645 out <<
" palette->SetLabelFont(" <<
fH->GetZaxis()->GetLabelFont() <<
");" << std::endl;
646 out <<
" palette->SetLabelOffset(" <<
fH->GetZaxis()->GetLabelOffset() <<
");" << std::endl;
647 out <<
" palette->SetLabelSize(" <<
fH->GetZaxis()->GetLabelSize() <<
");" << std::endl;
648 out <<
" palette->SetMaxDigits(" <<
fH->GetZaxis()->GetMaxDigits() <<
");" << std::endl;
649 out <<
" palette->SetTickLength(" <<
fH->GetZaxis()->GetTickLength() <<
");" << std::endl;
650 out <<
" palette->SetTitleOffset(" <<
fH->GetZaxis()->GetTitleOffset() <<
");" << std::endl;
651 out <<
" palette->SetTitleSize(" <<
fH->GetZaxis()->GetTitleSize() <<
");" << std::endl;
652 out <<
" palette->SetTitleColor(" <<
fH->GetZaxis()->GetTitleColor() <<
");" << std::endl;
653 out <<
" palette->SetTitleFont(" <<
fH->GetZaxis()->GetTitleFont() <<
");" << std::endl;
654 out <<
" palette->SetTitle(" << quote <<
fH->GetZaxis()->GetTitle() << quote <<
");" << std::endl;
669 gPad->SetView(
nullptr);
671 fH->GetZaxis()->SetRange(0, 0);
672 if (
fH->GetDimension() == 2) {
Option_t Option_t SetFillStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TStyle * gStyle
virtual void Modify()
Change current fill area attributes if necessary.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
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.
TH1 is the base class of all histogram classes in ROOT.
@ kUserContour
User specified contour levels.
@ kIsZoomed
Bit set when zooming on Y axis.
To draw Mathematical Formula.
virtual void PaintLatex(Double_t x, Double_t y, Double_t angle, Double_t size, const char *text)
Main drawing function.
Use the TLine constructor to create a simple line.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
TObject()
TObject constructor.
The palette painting class.
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
Check if mouse on the axis region.
void Paint(Option_t *option="") override
Paint the palette.
TGaxis fAxis
Palette axis.
TPaletteAxis & operator=(const TPaletteAxis &)
Assignment operator.
~TPaletteAxis() override
Palette destructor.
char * GetObjectInfo(Int_t px, Int_t py) const override
Displays the z value corresponding to cursor position py.
TPaletteAxis()
Palette default constructor.
Int_t GetBinColor(Int_t i, Int_t j)
Returns the color index of the bin (i,j).
void Copy(TObject &palette) const override
Copy a palette to a palette.
TH1 * fH
! Pointer to parent histogram
virtual void UnZoom()
Unzoom the palette.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Check if mouse on the axis region.
Int_t GetValueColor(Double_t zc)
Returns the color index of the given z value.
TPave()
Pave default constructor.
Double_t GetY2NDC() const
virtual void ConvertNDCtoPad()
Convert pave coordinates from NDC to Pad coordinates.
Double_t GetX2NDC() const
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
TString fOption
Pave style.
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.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
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.