THistPainter


class description - source file - inheritance tree

class THistPainter : public TVirtualHistPainter


    public:
THistPainter THistPainter() THistPainter THistPainter(THistPainter&) virtual void ~THistPainter() static TClass* Class() 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 TClass* IsA() const virtual Int_t MakeChopt(Option_t* option) virtual void Paint(Option_t* option) virtual void PaintArrows() virtual void PaintAxis() virtual void PaintBoxes() virtual void PaintColorLevels() virtual void PaintContour() 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() virtual void PaintFrame() virtual void PaintFunction() virtual void PaintH3(Option_t* option) virtual void PaintHist() virtual Int_t PaintInit() virtual void PaintLego() virtual void PaintLegoAxis(TGaxis* axis, Double_t ang) virtual void PaintPalette() virtual void PaintScatterPlot() virtual void PaintStat(Int_t dostat, TF1* fit) virtual void PaintStat2(Int_t dostat, TF1* fit) virtual void PaintSurface() virtual void PaintTable() virtual void PaintText() virtual void PaintTitle() virtual void RecalculateRange() virtual void SetHistogram(TH1* h) 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 TLego* fLego pointer to a TLego object Double_t* fXbuf X buffer coodinates Double_t* fYbuf Y buffer coodinates Int_t fNIDS Number of stacked histograms public:

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


Int_t MakeChopt(Option_t *choptin)
*-*-*-*-*-*-*-*-*Decode string chopt and fill Hoption 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"   : Draw only histo contour. (if histo has errors, errors are not drawn)
    "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

  The following options are supported for 1-D types:
    "AH"     : Draw histogram, but not the axis labels and tick marks
    "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
    "*H"     : Draw histogram with a * at each bin


  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)

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

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

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

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

 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

 When trailing digits is left out, they are assumed to be 0.
 For example: gStyle->SetOptStat(11);
 displays only the name of histogram and the number of entries.

When the option "same", the statistic box is not redrawn, and hence
 the statistics from the previously drawn hostgram will still show.
 With the option "sames", you can rename a previous "stats" box
 and/or change its position with these lines:

  Root > TPaveStats *st = (TPaveStats*)gPad->FindObject("stats")
  Root > st->SetName(newname)
  Root > st->SetX1NDC(newx1); //new x start position
  Root > st->SetX2NDC(newx2); //new x end position
  Root > newhist->Draw("sames")

 Fit Statistics
 ==============
 You can change the statistics box to display the fit paramters with
 the TH1::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 SCATter plot option (default for 2-D histograms)
 =======================
  For each cell (i,j) a number of points proportional to the cell content is drawn.
  A maximum of 500 points per cell are drawn. If the maximum is above 500
  contents are normalized to 500.


  The ARRow option.  Shows gradient between adjacent cells
  ================
    For each cell (i,j) an arrow is drawn
    The orientation of the arrow follows the cell gradient



  The BOX option
  ==============
    For each cell (i,j) a box is drawn with surface proportional to contents


  The COLor option
  ==============
  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::SetPalette.

/*

*/



  The TEXT Option
  ===============
    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

/*

*/



  The CONTour options
  ===================
  The following contour options are supported:
    "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)

  The default number of contour levels is 20 equidistant levels and can
  be changed with TH1::SetContour.

  When option "LIST" is specified together with option "CONT",
  the points used to draw the contours are saved in the TGraph object
  and are accessible in the following way:

     TObjArray *contours =
           gROOT->GetListOfSpecials()->FindObject("contours")
     Int_t ncontours = contours->GetSize();
     TList *list = (TList*)contours->At(i);

 Where i is a contour number, and 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();


/*

*/




  The LEGO options
  ================
    In a lego plot the cell contents are drawn as 3-d boxes, with
    the height of the box proportional to the cell content.
    A lego plot can be represented in several coordinate systems, the
    default system is Cartesian coordinates.
    Other possible coordinate systems are CYL,POL,SPH,PSR.

    "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

      See TStyle::SetPalette to change the color palette.
      We suggest you use palette 1 with the call
        gStyle->SetColorPalette(1)


/*

*/



   The "SURFace" options
   ==================
  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.
  The default is cartesian coordinates, and the other possible systems
  are CYL,POL,SPH,PSR.

    "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

  The following picture uses SURF1.

      See TStyle::SetPalette to change the color palette.
      We suggest you use palette 1 with the call
      gStyle->SetColorPalette(1)


/*

*/



  Option "Z" : Adding the color palette on the right side of the pad
  ==================================================================
 When this option is specified, a color palette with an axis indicating
 the value of the corresponding color is drawn on the right side of
 the picture. In case, not enough space is left, you can increase the size
 of the right margin by calling TPad::SetRightMargin.
 The attributes used to display the palette axis values are taken from
 the Z axis of the object. For example, you can set the labels size
 on the palette axis via hist->GetZaxis()->SetLabelSize().

  Setting the color palette
  =========================
 You can set the color palette with TStyle::SetPalette, eg

      gStyle->SetPalette(ncolors,colors);

 For example the option "COL" draws a 2-D histogram with cells
 represented by a box filled with a color index which is a function
 of the cell content.
 If the cell content is N, the color index used will be the color number
 in colors[N],etc. If the maximum cell content is > ncolors, all
 cell contents are scaled to ncolors.

 if ncolors <= 0, a default palette (see below) of 50 colors is defined.
 This palette is recommended for pads, labels

 if ncolors == 1 && colors == 0, a pretty palette with a violet to red
 spectrum is created. We recommend you use this palette when drawing legos,
 surfaces or contours.

 if ncolors > 0 and colors == 0, the default palette is used
 with a maximum of ncolors.

 The default palette defines:
   index  0  to  9 : shades of grey
   index 10  to 19 : shades of brown
   index 20  to 29 : shades of blue
   index 30  to 39 : shades of red
   index 40  to 49 : basic colors

  The color numbers specified in the palette can be viewed by selecting
  the item "colors" in the "VIEW" menu of the canvas toolbar.
  The color'a red, green, and blue values can be changed via TColor::SetRGB.


   Drawing options for 3-D histograms
   ==================================
   By default a 3-d scatter plot is drawn
   If option "BOX" is specified, a 3-D box with a volume proportional
   to the cell content is drawn.


--------------------------------------------------------------------

void PaintArrows()
*-*-*-*-*-*-*-*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()
*-*-*-*-*-*-*-*-*-*-*-*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 PaintBoxes()
*-*-*-*-*-*-*-*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()
*-*-*-*-*-*-*-*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::SetPalette.

/*

*/

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

void PaintContour()
*-*-*-*-*-*-*-*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 =
*-*           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()
*-*-*-*-*-*-*-*-*-*-*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.

/*

*/

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

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

void PaintFunction()
*-*-*-*-*-*-*-*-*-*-*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);
   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()
*-*-*-*-*-*-*-*-*-*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*-*-*-*
*-*          =========================================================

void PaintLego()
*-*-*-*-*-*-*-*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 TLego for more examples of lego options.

      See TStyle::SetPalette 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()
*-*-*-*-*-*-*-*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 500 points per cell is drawn. If the maximum is above 500
*-*    contents are normalized to 500.

/*

*/

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

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 rename a previous "stats" box and/or change its position
  Root > TPaveStats *st = (TPaveStats*)gPad->FindObject("stats")
  Root > st->SetName(newname)
  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()
*-*-*-*-*-*-*-*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::SetPalette 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 PaintTable()
*-*-*-*-*-*-*-*-*-*Control function to draw 2-D/3-D tables*-*-*-*-*-*-*-*
*-*                =======================================

void PaintText()
*-*-*-*-*-*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

/*

*/

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

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

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


             TClass* Class()
             TClass* IsA() const
                void ShowMembers(TMemberInspector& insp, char* parent)
                void Streamer(TBuffer& b)
                void StreamerNVirtual(TBuffer& b)
        THistPainter THistPainter(THistPainter&)


Author: Rene Brun 26/08/99
Last update: root/histpainter:$Name: $:$Id: THistPainter.cxx,v 1.35 2001/03/07 12:57:02 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.