THistPainter


class description - source file - inheritance tree

class THistPainter : public TVirtualHistPainter


    public:
THistPainter() THistPainter(const THistPainter&) virtual ~THistPainter() static TClass* Class() virtual void DefineColorLevels(Int_t ndivz) virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) virtual void DrawPanel() virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py) virtual void FitPanel() virtual char* GetObjectInfo(Int_t px, Int_t py) const virtual TList* GetStack() const virtual TClass* IsA() const virtual Bool_t IsInside(Int_t x, Int_t y) virtual Bool_t IsInside(Double_t x, Double_t y) virtual Int_t MakeChopt(const Option_t* option) virtual Int_t MakeCuts(char* cutsopt) virtual void Paint(const Option_t* option) virtual void PaintArrows(const Option_t* option) virtual void PaintAxis(Bool_t drawGridOnly = kFALSE) virtual void PaintBar(const Option_t* option) virtual void PaintBarH(const Option_t* option) virtual void PaintBoxes(const Option_t* option) virtual void PaintColorLevels(const Option_t* option) virtual void PaintContour(const Option_t* option) virtual Int_t PaintContourLine(Double_t elev1, Int_t icont1, Double_t x1, Double_t y1, Double_t elev2, Int_t icont2, Double_t x2, Double_t y2, Double_t* xarr, Double_t* yarr, Int_t* itarr, Double_t* levels) virtual void PaintErrors(const Option_t* option) virtual void PaintFrame() virtual void PaintFunction(const Option_t* option) virtual void PaintH3(const Option_t* option) virtual void PaintH3Iso() virtual void PaintHist(const Option_t* option) virtual Int_t PaintInit() virtual Int_t PaintInitH() virtual void PaintLego(const Option_t* option) virtual void PaintLegoAxis(TGaxis* axis, Double_t ang) virtual void PaintPalette() virtual void PaintScatterPlot(const Option_t* option) virtual void PaintStat(Int_t dostat, TF1* fit) virtual void PaintStat2(Int_t dostat, TF1* fit) virtual void PaintSurface(const Option_t* option) virtual void PaintTable(const Option_t* option) virtual void PaintText(const Option_t* option) virtual void PaintTF3() virtual void PaintTitle() virtual void ProcessMessage(const char* mess, const TObject* obj) virtual void RecalculateRange() virtual void RecursiveRemove(TObject*) virtual void SetHistogram(TH1* h) virtual void SetStack(TList* stack) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual Int_t TableInit()

Data Members


    protected:
TH1* fH pointer to histogram to paint TAxis* fXaxis pointer to X axis TAxis* fYaxis pointer to Y axis TAxis* fZaxis pointer to Z axis TList* fFunctions pointer to histogram list of functions TPainter3dAlgorithms* fLego pointer to a TPainter3dAlgorithms object Double_t* fXbuf X buffer coordinates Double_t* fYbuf Y buffer coordinates Int_t fNcuts Number of graphical cuts Int_t fCutsOpt[16] sign of each cut TCutG* fCuts[16] Pointers to graphical cuts TList* fStack Pointer to stack of histograms (if any)

Class Description

   The histogram painter class
   ===========================

  Histograms are drawn via the THistPainter class. Each histogram has
  a pointer to its own painter (to be usable in a multithreaded program).
  When the canvas has to be redrawn, the Paint function of the objects
  in the pad is called. In case of histograms, TH1::Paint invokes directly
  THistPainter::Paint.

    See THistPainter::Paint for the list of drawing options
    and examples.

THistPainter()
    *-*-*-*-*-*-*-*-*Histogram default constructor*-*-*-*-*-*-*-*-*-*-*-*-*
                     =============================

~THistPainter()
    *-*-*-*-*-*-*-*-*Histogram default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*
                     ============================

Int_t DistancetoPrimitive(Int_t px, Int_t py)
    *-*-*-*-*-*-*-*-*Compute distance from point px,py to a line*-*-*-*-*-*
                     ===========================================
     Compute the closest distance of approach from point px,py to elements
     of an histogram.
     The distance is computed in pixels units.

     Algorithm:
     Currently, this simple model computes the distance from the mouse
     to the histogram contour only.

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void DrawPanel()
    *-*-*-*-*Display a panel with all histogram drawing options*-*-*-*-*-*
             ==================================================

      See class TDrawPanelHist for example

void ExecuteEvent(Int_t event, Int_t px, Int_t py)
    *-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
                     =========================================
     This member function is called when a histogram is clicked with the locator

     If Left button clicked on the bin top value, then the content of this bin
     is modified according to the new position of the mouse when it is released.

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void FitPanel()
    *-*-*-*-*Display a panel with all histogram fit options*-*-*-*-*-*
             ==============================================

      See class TFitPanel for example

char* GetObjectInfo(Int_t px, Int_t py) const
   Redefines TObject::GetObjectInfo.
   Displays the histogram info (bin number, contents, integral up to bin
   corresponding to cursor position px,py


Bool_t IsInside(Int_t ix, Int_t iy)
 return kTRUE if the cell ix, iy is inside one of the graphical cuts

Bool_t IsInside(Double_t x, Double_t y)
 return kTRUE if the point x,y is inside one of the graphical cuts

Int_t MakeChopt(Option_t *choptin)
    *-*-*-*-*-*-*Decode string chopt and fill Hoption structure*-*-*-*-*-*-*
                 ==============================================

Int_t MakeCuts(char *choptin)
    *-*-*-*-*-*-*Decode string chopt and fill Graphical cuts structure
                 =====================================================

void Paint(Option_t *option)
    *-*-*-*-*-*-*Control routine to paint any kind of histograms*-*-*-*-*-*-*
                 ===============================================

 When you call the Draw method of a histogram for the first time (TH1::Draw),
 it creates a THistPainter object and saves a pointer to painter as a
 data member of the histogram.
 The THistPainter class specializes in the drawing of histograms. It is
 separate from the histogram so that one can have histograms without
 the graphics overhead, for example in a batch program. The choice
 to give each histogram have its own painter rather than a central
 singleton painter, allows two histograms to be drawn in two threads
 without overwriting the painter's values.

 When a displayed histogram is filled again you do not have to call the Draw
 method again. The image is refreshed the next time the pad is updated.
 A pad is updated after one of these three actions:
   - a carriage control on the ROOT command line
   - a click inside the pad
   - a call to TPad::Update

 By default a call to TH1::Draw clears the pad of all objects before drawing the
 new image of the histogram. You can use the "SAME" option to leave the previous
 display intact and superimpose the new histogram. The same histogram can be
 drawn with different graphics options in different pads.

 When a displayed histogram is deleted, its image is automatically removed from the pad.

 To create a copy of the histogram when drawing it, you can use TH1::DrawClone. This
 will clone the histogram and allow you to change and delete the original one
 without affecting the clone.

 Setting the Style
 =================
 Histograms use the current style (gStyle). When you change the current style and
 would like to propagate the change to the histogram you can call TH1::UseCurrentStyle.
 You will need to call UseCurrentStyle on each histogram.
 When reading many histograms from a file and you wish to update them to the current
 style you can use gROOT::ForceStyle and all histograms read after this call
 will be updated to use the current style.

  The following options are supported on all types:
  =================================================
    "AXIS"   : Draw only axis
    "HIST"   : When an histogram has errors it is visualized by default with
               error bars. To visualize it without errors use the option HIST
               together with the required option (eg "hist same c")
    "SAME"   : Superimpose on previous picture in the same pad
    "CYL"    : Use Cylindrical coordinates
    "POL"    : Use Polar coordinates
    "SPH"    : Use Spherical coordinates
    "PSR"    : Use PseudoRapidity/Phi coordinates
    "LEGO"   : Draw a lego plot with hidden line removal
    "LEGO1"  : Draw a lego plot with hidden surface removal
    "LEGO2"  : Draw a lego plot using colors to show the cell contents
    "SURF"   : Draw a surface plot with hidden line removal
    "SURF1"  : Draw a surface plot with hidden surface removal
    "SURF2"  : Draw a surface plot using colors to show the cell contents
    "SURF3"  : same as SURF with in addition a contour view drawn on the top
    "SURF4"  : Draw a surface using Gouraud shading
    "SURF5"  : Same as SURF3 but only the colored contour is drawn. Used with
               option CYL, SPH or PSR it allows to draw colored contours on a
               sphere, a cylinder or a in pseudo rapidy space. In cartesian
               or polar coordinates, option SURF3 is used.

  The following options are supported for 1-D types:
    "AH"     : Draw histogram, but not the axis labels and tick marks
    "]["     : When this option is selected the first and last vertical lines
             : of the histogram are not drawn.
    "B"      : Bar chart option
    "C"      : Draw a smooth Curve througth the histogram bins
    "E"      : Draw error bars
    "E0"     : Draw error bars including bins with o contents
    "E1"     : Draw error bars with perpendicular lines at the edges
    "E2"     : Draw error bars with rectangles
    "E3"     : Draw a fill area througth the end points of the vertical error bars
    "E4"     : Draw a smoothed filled area through the end points of the error bars
    "L"      : Draw a line througth the bin contents
    "P"      : Draw current marker at each bin except empty bins
    "P0"     : Draw current marker at each bin including empty bins
    "*H"     : Draw histogram with a * at each bin
    "LF2"    : Draw histogram like with option "L" but with a fill area.
             : Note that "L" draws also a fill area if the hist fillcolor is set
             : but the fill area corresponds to the histogram contour.
    "9"      : Force histogram to be drawn in high resolution mode.
             : By default, the histogram is drawn in low resolution
             : in case the number of bins is greater than the number of pixels
             : in the current pad.


  The following options are supported for 2-D types:
    "ARR"    : arrow mode. Shows gradient between adjacent cells
    "BOX"    : a box is drawn for each cell with surface proportional to contents
    "COL"    : a box is drawn for each cell with a color scale varying with contents
    "COLZ"   : same as "COL". In addition the color palette is also drawn
    "CONT"   : Draw a contour plot (same as CONT0)
    "CONT0"  : Draw a contour plot using surface colors to distinguish contours
    "CONT1"  : Draw a contour plot using line styles to distinguish contours
    "CONT2"  : Draw a contour plot using the same line style for all contours
    "CONT3"  : Draw a contour plot using fill area colors
    "CONT4"  : Draw a contour plot using surface colors (SURF option at theta = 0)
    "LIST"   : Generate a list of TGraph objects for each contour
    "FB"     : With LEGO or SURFACE, suppress the Front-Box
    "BB"     : With LEGO or SURFACE, suppress the Back-Box
    "SCAT"   : Draw a scatter-plot (default)
    "TEXT"   : Draw cell contents as text
    "[cutg]" : Draw only the sub-range selected by the TCutG named "cutg"

 Most options can be concatenated without spaces or commas, for example:
        h->Draw("E1 SAME");

 The options are not case sensitive:
	h->Draw("e1 same");

 The options "BOX", "COL" or "COLZ", use the color palette
 defined in the current style (see TStyle::SeTPaletteAxis)

 The options "CONT" or "SURF" or "LEGO" have by default 20 equidistant contour
 levels, you can change the number of levels with TH1::SetContour or
 TStyle::SetNumberContours.

 You can also set the default drawing option with TH1::SetOption. To see the current
 option use TH1::GetOption.

 Setting line, fill, marker, and text attributes
 =====================================
 The histogram classes inherit from the attribute classes:
    TAttLine, TAttFill, TAttMarker and TAttText.
 See the description of these classes for the list of options.


  Setting Tick marks on the histogram axis
  ========================================
 The TPad::SetTicks method specifies the type of tick marks on the axis.

 Assume tx = gPad->GetTickx() and ty = gPad->GetTicky().

    tx = 1 ;  tick marks on top side are drawn (inside)
    tx = 2;   tick marks and labels on top side are drawn
    ty = 1;   tick marks on right side are drawn (inside)
    ty = 2;   tick marks and labels on right side are drawn
 By default only the left Y axis and X bottom axis are drawn (tx = ty = 0)

 Use TPad::SetTicks(tx,ty) to set these options
 See also The TAxis functions to set specific axis attributes.

  In case multiple collor filled histograms are drawn on the same pad, the fill
  area may hide the axis tick marks. One can force a redraw of the axis
  over all the histograms by calling:
    gPad->RedrawAxis();


  Giving titles to the X, Y and Z axis
  =================================
    h->GetXaxis()->SetTitle("X axis title");
    h->GetYaxis()->SetTitle("Y axis title");
  The histogram title and the axis titles can be any TLatex string.
  The titles are part of the persistent histogram.


  Superimposing two histograms with different scales in the same pad
  ==================================================================
  The following script creates two histograms, the second histogram is
  the bins integral of the first one. It shows a procedure to
  draw the two histograms in the same pad and it draws the scale of
  the second histogram using a new vertical axis on the right side.

   void twoscales() {
    TCanvas *c1 = new TCanvas("c1","hists with different scales",600,400);

     //create/fill draw h1
     gStyle->SetOptStat(kFALSE);
     TH1F *h1 = new TH1F("h1","my histogram",100,-3,3);
     Int_t i;
     for (i=0;i<10000;i++) h1->Fill(gRandom->Gaus(0,1));
     h1->Draw();
     c1->Update();

     //create hint1 filled with the bins integral of h1
     TH1F *hint1 = new TH1F("hint1","h1 bins integral",100,-3,3);
     Float_t sum = 0;
     for (i=1;i<=100;i++) {
        sum += h1->GetBinContent(i);
        hint1->SetBinContent(i,sum);
     }

     //scale hint1 to the pad coordinates
     Float_t rightmax = 1.1*hint1->GetMaximum();
     Float_t scale = gPad->GetUymax()/rightmax;
     hint1->SetLineColor(kRed);
     hint1->Scale(scale);
     hint1->Draw("same");

     //draw an axis on the right side
     TGaxis *axis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(),
           gPad->GetUxmax(), gPad->GetUymax(),0,rightmax,510,"+L");
     axis->SetLineColor(kRed);
     axis->SetTextColor(kRed);
     axis->Draw();
 }

/*

*/



 Statistics Display
 ======================================
 The type of information shown in the histogram statistics box
  can be selected with gStyle->SetOptStat(mode).

  The mode has up to seven digits that can be set to on(1) or off(0).

  mode = iourmen  (default = 0001111)
    n = 1;  name of histogram is printed
    e = 1;  number of entries printed
    m = 1;  mean value printed
    r = 1;  rms printed
    u = 1;  number of underflows printed
    o = 1;  number of overflows printed
    i = 1;  integral of bins printed

 For example: gStyle->SetOptStat(11);
 displays only the name of histogram and the number of entries.
 For example: gStyle->SetOptStat(1101);
 displays the name of histogram, mean value and RMS.
 WARNING: never call SetOptStat(000111); but SetOptStat(1111), 0001111 will
          be taken as an octal number !!
 SetOptStat can also take any combination of letters IOURMEN as its argument.
 For example gStyle->SetOptStat("NE"), gStyle->SetOptStat("NMR") and
 gStyle->SetOptStat("RMEN") are equivalent to the examples above.

 With the option "same", the statistic box is not redrawn.
 With the option "sames", the statistic box is drawn. If it hiddes
 the previous statistics box, you can change its position
 with these lines (if h is the pointer to the histogram):

  Root > TPaveStats *st = (TPaveStats*)h->GetListOfFunctions()->FindObject("stats")
  Root > st->SetX1NDC(newx1); //new x start position
  Root > st->SetX2NDC(newx2); //new x end position

 Fit Statistics
 ==============
 You can change the statistics box to display the fit parameters with
 the TStyle::SetOptFit(mode) method. This mode has four digits.
 mode = pcev  (default = 0111)
    v = 1;  print name/values of parameters
    e = 1;  print errors (if e=1, v must be 1)
    c = 1;  print Chisquare/Number of degress of freedom
    p = 1;  print Probability

 For example: gStyle->SetOptFit(1011);
 prints the fit probability, parameter names/values, and errors.


  The ERROR bars options
  ======================
   'E' default. Shows only the error bars, not a marker
   'E1' Small lines are drawn at the end of the error bars.
   'E2' Error rectangles are drawn.
   'E3' A filled area is drawn through the end points of the vertical error bars.
   '4' A smoothed filled area is drawn through the end points of the
       vertical error bars.
   'E0' Draw also bins with null contents.

/*

*/


  The BAR options
  ===============
  When the option "bar" or "hbar" is specified, a bar chart is drawn.
   ----Vertical BAR chart: Options "bar","bar0","bar1","bar2","bar3","bar4"
  The bar is filled with the histogram fill color
  The left side of the bar is drawn with a light fill color
  The right side of the bar is drawn with a dark fill color
  The percentage of the bar drawn with either the light or dark color
    is  0 per cent for option "bar" or "bar0"
    is 10 per cent for option "bar1"
    is 20 per cent for option "bar2"
    is 30 per cent for option "bar3"
    is 40 per cent for option "bar4"

  Use TH1::SetBarWidth to control the bar width (default is the bin width)
  Use TH1::SetBarOffset to control the bar offset (default is 0)
    See example in $ROOTSYS/tutorials/hbars.C

/*

*/


   ----Horizontal BAR chart: Options "hbar","hbar0","hbar1","hbar2","hbar3","hbar4"
  An horizontal bar is drawn for each bin.
  The bar is filled with the histogram fill color
  The bottom side of the bar is drawn with a light fill color
  The top side of the bar is drawn with a dark fill color
  The percentage of the bar drawn with either the light or dark color
    is  0 per cent for option "hbar" or "hbar0"
    is 10 per cent for option "hbar1"
    is 20 per cent for option "hbar2"
    is 30 per cent for option "hbar3"
    is 40 per cent for option "hbar4"

  Use TH1::SetBarWidth to control the bar width (default is the bin width)
  Use TH1::SetBarOffset to control the bar offset (default is 0)
    See example in $ROOTSYS/tutorials/hbars.C

/*

*/


void PaintArrows(Option_t *)
    *-*-*-*-*-*Control function to draw a table as an arrow plot*-*-*-*-*-*
               =================================================

       For each cell (i,j) an arrow is drawn
       The orientation of the arrow follows the cell gradient

/*

*/


    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void PaintAxis(Bool_t drawGridOnly)
    *-*-*-*-*-*-*-*-*-*Draw axis of an histogram*-*-*-*-*-*-*-*-*-*-*-*-*
                       =========================

   Assume tx = gPad->GetTickx() and ty = gPad->GetTicky()
   by default only the left Y axis and X bottom axis are drawn (tx = ty = 0)
    tx = 1 ;  tick marks on top side are drawn (inside)
    tx = 2;   tick marks and labels on top side are drawn
    ty = 1;   tick marks on right side are drawn (inside)
    ty = 2;   tick marks and labels on right side are drawn
       Use TPad::SetTicks(tx,ty) to set these options

void PaintBar(Option_t *)
  Draw a bar chart in a normal pad.
     (see PaintBarH to draw a bar chart in a rotated pad)
 This function is called by THistPainter::Paint when the option "bar"
 has been specified.

 A vertical bar is drawn for each bin.
 The bar is filled with the histogram fill color
 The left side of the bar is drawn with a light fill color
 The right side of the bar is drawn with a dark fill color
 The percentage of the bar drawn with either the light or dark color
   is  0 per cent for option "bar" or "bar0"
   is 10 per cent for option "bar1"
   is 20 per cent for option "bar2"
   is 30 per cent for option "bar3"
   is 40 per cent for option "bar4"

 Use TH1::SetBarWidth to control the bar width (default is the bin width)
 Use TH1::SetBarOffset to control the bar offset (default is 0)
   See example in $ROOTSYS/tutorials/hbars.C

/*

*/


void PaintBarH(Option_t *)
 Draw a bar char in a rotated pad (X vertical, Y horizontal)
     (see PaintBar to draw a bar chart in a normal pad)
 This function is called by THistPainter::Paint when the option "hbar"
 has been specified.

 An horizontal bar is drawn for each bin.
 The bar is filled with the histogram fill color
 The bottom side of the bar is drawn with a light fill color
 The top side of the bar is drawn with a dark fill color
 The percentage of the bar drawn with either the light or dark color
   is  0 per cent for option "hbar" or "hbar0"
   is 10 per cent for option "hbar1"
   is 20 per cent for option "hbar2"
   is 30 per cent for option "hbar3"
   is 40 per cent for option "hbar4"

 Use TH1::SetBarWidth to control the bar width (default is the bin width)
 Use TH1::SetBarOffset to control the bar offset (default is 0)
   See example in $ROOTSYS/tutorials/hbars.C

/*

*/


void PaintBoxes(Option_t *)
    *-*-*-*-*-*Control function to draw a table as a box plot*-*-*-*-*-*
               ==============================================

       For each cell (i,j) a box is drawn.
       The size of the box is proportional to the cell content.

/*

*/


    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void PaintColorLevels(Option_t *)
    *-*-*-*-*-*Control function to draw a table as a color plot*-*-*-*-*-*
               ================================================

       For each cell (i,j) a box is drawn with a color proportional
       to the cell content.
       The color table used is defined in the current style (gStyle).
       The color palette in TStyle can be modified via TStyle::SeTPaletteAxis.

/*

*/


    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void PaintContour(Option_t *option)
    *-*-*-*-*-*Control function to draw a table as a contour plot*-*-*-*-*-*
               =================================================
     Hoption.Contour may have the following values:
        1  The contour is drawn with filled colour levels. ("cont")
       11  Use colour to distinguish contours. ("cont1")
       12  Use line style to distinguish contours. ("cont2")
       13  Line style and colour are the same for all contours. ("cont3")
       14  same as 1 but uses the "SURF" algorithm ("cont4")

     When option "List" is specified together with option "cont",
     the points used to draw the contours are saved in the TGraph format
     and are accessible in the following way:
    TObjArray *contours =
            (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours")
    Int_t ncontours = contours->GetSize();
    TList *list = (TList*)contours->At(i); //where i is a contour number
    list contains a list of TGraph objects. For one given contour, more than
    one disjoint polyline may be generated. The number of TGraphs per
    countour is given by list->GetSize().
    Here we show only the case to access the first graph in the list.
       TGraph *gr1 = (TGraph*)list->First();



/*

*/


    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Int_t PaintContourLine(Double_t elev1, Int_t icont1, Double_t x1, Double_t y1, Double_t elev2, Int_t icont2, Double_t x2, Double_t y2, Double_t *xarr, Double_t *yarr, Int_t *itarr, Double_t *levels)
    *-*-*-*-*-*Fill the matrix XARR YARR for Contour Plot*-*-*-*-*-*-*-*
               ==========================================


void PaintErrors(Option_t *)
    *-*-*-*-*-*-*-*-*Draw histogram error bars*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

       Draws error bars for the current histogram. The current polymarker
       is drawn at the centre of the errors according to CHOPT:

       ' ' Coordinates are expressed in histogram coordinates
           (of the last drawn histogram). Error bars are drawn.
       '1' Small lines are drawn at the end of the error bars.
       '2' Error rectangles are drawn.
       '3' A filled area is drawn through the end points of the vertical
           error bars.
       '4' A smoothed filled area is drawn through the end points of the
           vertical error bars.
       '0' Turn off the symbols clipping.

     Note that for all options, the line and fill attributes of the
     histogram are used for the errors or errors contours.

     Use gStyle->SetErrorX(dx) to control the size of the error along x.
     set dx = 0 to suppress the error along x.

     Use gStyle->SetEndErrorSize(np) to control the size of the lines
     at the end of the error bars (when option 1 is used).
     By default np=1. (np reprersents the number of pixels).

/*

*/

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void PaintFrame()
    *-*-*-*-*-*-*-*Calculate range and clear pad (canvas)*-*-*-*-*-*-*-*-*-*
                   ======================================

void PaintFunction(Option_t *)
    *-*-*-*-*-*-*-*-*Paint functions associated to an histogram*-*-*-*-*-*-*
                     ==========================================

   An associated function is created by THistPainter::Fit. Note that more than
   on fitted function can be associated with one histogram (see THistPainter::Fit).

   A TF1 object can be added to the list of associated functions directly
   by a user without calling THistPainter::Fit.
   To add a new function to the list of associated functions, do
     h->GetListOfFunctions()->Add(f1);
        or
     h->GetListOfFunctions()->Add(f1,someoption);
   To retrieve a function by name from this list, do:
     TF1 *f1 = (TF1*)h->GetListOfFunctions()->FindObject(name);
   or
     TF1 *f1 = h->GetFunction(name);


void PaintHist(Option_t *)
    *-*-*-*-*-*-*-*Control routine to draw an histogram*-*-*-*-*-*-*-*-*-*-*
                   ====================================

void PaintH3(Option_t *option)
    *-*-*-*-*-*-*-*Control function to draw a 3-D histogram*-*-*-*-*-*-*-*-*
                   ========================================

Int_t PaintInit()
    *-*-*-*-*Compute histogram parameters used by the drawing routines*-*-*-*
             =========================================================

Int_t PaintInitH()
    Compute histogram parameters used by the drawing routines
    for a rotated pad

void PaintH3Iso()
 Control function to draw a 3d histogram with Iso Surfaces.

 Thanks to the function IsoSurface of the TPainter3dAlgorithms class, this
 function paints a Gouraud shaded 3d iso surface though a 3d histogram.

 This first implementation paint one surface at the value computed as follow:
 SumOfWeights/(NbinsX*NbinsY*NbinsZ)

 Example:

  #include "TH3.h"
  #include "TRandom.h"

  void hist3d() {
     TH3F *h3 = new TH3F("h3","h3",20,-2,2,20,-2,2,20,0,4);
     Double_t x, y, z;
     for (Int_t i=0;i<10000;i++) {
        gRandom->Rannor(x, y);
        z = x*x + y*y;
        h3->Fill(x,y,z);
     }
     h3->Draw("iso");
  }


   /*
   
   */


void PaintLego(Option_t *)
    *-*-*-*-*-*Control function to draw a table as a lego plot*-*-*-*-*-*
               ===============================================

        In a lego plot, cell contents are represented as 3-d boxes.
        The height of the box is proportional to the cell content.

       A lego plot can be represented in several coordinate systems.
       Default system is Cartesian coordinates.
       Possible systems are CYL,POL,SPH,PSR.

      See THistPainter::Draw for the list of Lego options.
      See TPainter3dAlgorithms for more examples of lego options.

      See TStyle::SeTPaletteAxis to change the color palette.
      It is suggested to use palette 1 via the call
      gStyle->SetColorPalette(1)


/*

*/


    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void PaintLegoAxis(TGaxis *axis, Double_t ang)
    *-*-*-*-*Draw the axis for legos and surface plots*-*-*-*-*-*-*-*-*-*
             =========================================


void PaintPalette()
    *-*-*-*-*-*Paint the color palette on the right side of the pad*-*-*-*-*
               ====================================================

void PaintScatterPlot(Option_t *option)
    *-*-*-*-*-*Control function to draw a table as a scatter plot*-*-*-*-*
               ==================================================

       For each cell (i,j) a number of points proportional to the cell
       content is drawn.
       A maximum of kNMAX points per cell is drawn. If the maximum is above kNMAX
       contents are normalized to kNMAX. (kNMAX=2000)
       if option is of the form "scat=ff", (eg scat=1.8, scat=1e-3), then
       ff is used as a scale factor to compute the number of dots.
       "scat=1" is the default.

/*

*/


    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void PaintStat(Int_t dostat, TF1 *fit)
    *-*-*-*-*-*-*-*-*-*Draw the statistics box*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
                       =======================
 The type of information printed in the histogram statistics box
  can be selected via gStyle->SetOptStat(mode).
  The parameter mode can be = iourmen  (default = 0001111)
    n = 1;  name of histogram is printed
    e = 1;  number of entries printed
    m = 1;  mean value printed
    r = 1;  rms printed
    u = 1;  number of underflows printed
    o = 1;  number of overflows printed
    i = 1;  integral of bins printed
  Example: gStyle->SetOptStat(11);
           print only name of histogram and number of entries.

 The type of information about fit parameters printed in the histogram
 statistics box can be selected via the parameter mode.
  The parameter mode can be = pcev  (default = 0111)
    v = 1;  print name/values of parameters
    e = 1;  print errors (if e=1, v must be 1)
    c = 1;  print Chisquare/Number of degress of freedom
    p = 1;  print Probability
  Example: gStyle->SetOptFit(1011);
           print fit probability, parameter names/values and errors.


  When option "same" is specified, the statistic box is not drawn.
  Specify option "sames" to force painting statistics with option "same"
  When option "sames" is given, one can use the following technique
  to move a previous "stats" box to a new position
  Root > TPaveStats *st = (TPaveStats*)gPad->GetPrimitive("stats")
  Root > st->SetX1NDC(newx1); //new x start position
  Root > st->SetX2NDC(newx2); //new x end position
  Root > newhist->Draw("sames")

void PaintStat2(Int_t dostat, TF1 *fit)
 Draw the statistics box for 2D histogram.
 The type of information printed in the histogram statistics box
 can be selected via gStyle->SetOptStat(mode).
 The parameter mode can be = ourmen  (default = 001111)
    n = 1;  name of histogram is printed
    e = 1;  number of entries printed
    m = 1;  mean value printed
    r = 1;  rms printed
    u = 1;  number of underflows printed
    o = 1;  number of overflows printed
    i = 1;  integral of bins printed
  Example: gStyle->SetOptStat(11);
           print only name of histogram and number of entries.

void PaintSurface(Option_t *)
    *-*-*-*-*-*Control function to draw a table as a surface plot*-*-*-*-*-*
               ==================================================

        In a surface plot, cell contents are represented as a mesh.
        The height of the mesh is proportional to the cell content.

       A surface plot can be represented in several coordinate systems.
       Default system is Cartesian coordinates.
       Possible systems are CYL,POL,SPH,PSR.

      See THistPainter::Draw for a list of Surface options
     The following picture is generated with option SURF1.

      See TStyle::SeTPaletteAxis to change the color palette.
      It is suggested to use palette 1 via the call
      gStyle->SetColorPalette(1)


/*

*/

     The following picture is generated with option SURF3.

/*

*/


    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void DefineColorLevels(Int_t ndivz)

void PaintTable(Option_t *option)
    *-*-*-*-*-*-*-*Control function to draw 2-D/3-D tables*-*-*-*-*-*-*-*
                   =======================================

void PaintText(Option_t *)
    *-*-*-*Control function to draw a table with the bin values*-*-*-*-*-*
           ====================================================

       For each cell (i,j) the cell content is printed.
       The text attributes are:
*_*      - text font = current TStyle font
         - text size = 0.02*padheight*markersize
         - text color= marker color
   By default the format "g" is used. This format can be redefined
   by calling gStyle->SetPaintTextFormat


/*

*/


    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

void PaintTF3()
 Control function to draw a 3d implicit functions.

 Thanks to the function ImplicitFunction of the TPainter3dAlgorithms class,
 this function paints 3d representation of an implicit function.

 Example:

   TF3 *fun3 = new TF3("fun3","sin(x*x+y*y+z*z-36)",-2,2,-2,2,-2,2);
   fun3->Draw();


   /*
   
   */


void PaintTitle()
    *-*-*-*-*-*-*-*-*-*Draw the histogram title*-*-*-*-*-*-*-*-*-*-*-*-*
                       ========================

void ProcessMessage(const char *mess, const TObject *obj)
  Process message mess

void RecalculateRange()
    *-*-*-*Recompute the histogram range following graphics operations*-*-*
           ===========================================================

void SetHistogram(TH1 *h)
  set current histogram to h

Int_t TableInit()
    *-*-*-*-*-*-*Initialize various options to draw tables*-*-*-*-*-*-*-*
                 =========================================



Inline Functions


              TList* GetStack() const
                void RecursiveRemove(TObject*)
                void SetStack(TList* stack)
             TClass* Class()
             TClass* IsA() const
                void ShowMembers(TMemberInspector& insp, char* parent)
                void Streamer(TBuffer& b)
                void StreamerNVirtual(TBuffer& b)
        THistPainter THistPainter(const THistPainter&)


Author: Rene Brun 26/08/99
Last update: root/histpainter:$Name: $:$Id: THistPainter.cxx,v 1.138 2003/05/13 14:59:36 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.