

When this option is selected the first and last vertical lines of the histogram are not drawn. For instance, "AC" draws the histogram as a smooth Curve without axis. "A" can be combined with any drawing option. Options supported for 1D histograms Optionĭraw histogram without axis. Palette Marker Color: histogram's marker color is taken in the current palette.ĭraw a lego plot with hidden line removal.ĭraw a lego plot with hidden surface removal.ĭraw a lego plot using colors to show the cell contents When the option "0" is used with any LEGO option, the empty bins are not drawn.ĭraw a lego plot with hidden surface removal, like LEGO1 but the border lines of each lego-bar are not drawn.ĭraw a lego plot with hidden surface removal, like LEGO1 but without the shadow effect on each lego-bar.ĭraw bin contents as text (format set via gStyle->SetPaintTextFormat).ĭraw bin contents as text at angle nn (0 SetHistMinimumZero(). Palette Line Color: histogram's line color is taken in the current palette. Palette Fill Color: histogram's fill color is taken in the current palette. Same as "SAME" and draw the statistics box Superimpose on previous picture in the same pad. When an histogram has a fitted function, this option allows to draw the fit result only. The "HIST" option can also be used to plot only the histogram and not the associated function(s). To visualize it without errors use the option "HIST" together with the required option (eg "hist same c"). When an histogram has errors it is visualized by default with error bars. Options supported for 1D and 2D histograms Optionĭraw only grid (if the grid is requested). Root h->GetOption() // Retrieve the default drawing option for "h" Root h->Draw() // Draw "h" using error bars Root h->SetOption("E") // Change the default drawing option for "h" Root h->Draw("E") // Draw "h" using error bars The default drawing option can be set with TH1::SetOption and retrieve using TH1::GetOption: root h->Draw() // Draw "h" using the standard histogram representation. The options are not case sensitive: h->Draw("e1 same") Most options can be concatenated with or without spaces or commas, for example: h->Draw("E1 SAME") This will clone the histogram and allow to change and delete the original one without affecting the clone. To create a copy of the histogram when drawing it, one can use TH1::DrawClone(). When a displayed histogram is deleted, its image is automatically removed from the pad. The same histogram can be drawn with different graphics options in different pads. One can use the SAME option to leave the previous display intact and superimpose the new histogram. a carriage control on the ROOT command line,īy default a call to TH1::Draw() clears the pad of all objects before drawing the new image of the histogram.When a displayed histogram is filled again, there is no need to call the Draw() method again the image will be refreshed the next time the pad will be updated.Ī pad is updated after one of these three actions: Each histogram having its own painter (rather than a central singleton painter painting all histograms), allows two histograms to be drawn in two threads without overwriting the painter's values. It is separated from the histogram so that one can have histograms without the graphics overhead, for example in a batch program. The THistPainter class specializes in the drawing of histograms. When the Draw() method of a histogram is called for the first time ( TH1::Draw), it creates a THistPainter object and saves a pointer to this "painter" as a data member of the histogram. THistPainter offers many options to paint 1D, 2D and 3D histograms. For instance to draw a 2D histogram as a lego plot it is enough to do: h->Draw("lego") To choose how the histogram will be drawn, the Draw() method can be invoked with an option. To draw a histogram h it is enough to do: h->Draw() In case of histograms, TH1::Paint invokes directly THistPainter::Paint. When the canvas has to be redrawn, the Paint function of each objects in the pad is called. Each histogram has a pointer to its own painter (to be usable in a multithreaded program). Histograms are drawn via the THistPainter class. Plot specific interactions (dynamic slicing etc.).General information: plot types and supported options.Drawing a sub-range of a 2-D histogram the option.Option "Z" : Adding the color palette on the right side of the pad.Base line for bar-charts and lego plots.Cylindrical, Polar, Spherical and PseudoRapidity/Phi options.The AITOFF, MERCATOR, SINUSOIDAL and PARABOLIC options.The SCATter plot option (default for 2D histograms).

Superimposing two histograms with different scales in the same pad.Setting Tick marks on the histogram axis.Setting line, fill, marker, and text attributes.Options supported for histograms' stacks (THStack).Options supported for 1D and 2D histograms.Implements all histograms' drawing's options.
