Examples showing the "histograms' classes" usage.
A histogram is a visual representation of the distribution of quantitative data. TH1 class introduces the basic data structure used in root for histograms.
In a nutshell:
Explore the examples below for different histogram classes
Tutorial | Description |
---|---|
hist000_TH1_first.C | First example. |
These examples shows some of the ratioplots
Tutorial | Description | |
---|---|---|
hist000_TH1_first.C | Hello World example for TH1. | |
hist001_TH1_fillrandom.C | hist001_TH1_fillrandom.py | Fill a 1D histogram with random values using predefined functions. |
hist002_TH1_fillrandom_userfunc.C | Fill a 1D histogram from a user-defined parametric function. | |
hist003_TH1_draw.C | Draw a 1D histogram to a canva. | |
hist004_TH1_labels.C | 1D histograms with alphanumeric labels. | |
hist005_TH1_palettecolor.C | Palette coloring for TH1. | |
hist006_TH1_bar_charts.C | Draw 1D histograms as bar charts. | |
hist007_TH1_liveupdate.C | hist007_TH1_liveupdate.py | Histograms filled and drawn in a loop. |
hist008_TH1_zoom.C | Change the range of an axis in a Histogram. | |
hist009_TH1_normalize.C | Normalizing a Histogram. | |
hist010_TH1_two_scales.C | hist010_TH1_two_scales.py | Draw two histograms on one canva using different y-axis scales. |
hist011_TH1_legend_autoplaced.C | Automatic placing of the legend. | |
hist012_TH1_hksimple.C | Dynamic filling of TH1K histograms. | |
hist013_TH1_rebin.C | Create a variable bin-width histogram and change bin sizes. | |
hist014_TH1_cumulative.C | Illustrate use of the TH1::GetCumulative method. | |
hist015_TH1_read_and_draw.C | hist015_TH1_read_and_draw.py | Read a 1D histogram from a ROOT File and draw it. |
hist016_TH1_different_scales_canvas.C | Draw two histograms on one canva using different y-axis scales. | |
hist017_TH1_smooth.C | Histogram smoothing. | |
hist060_TH1_stats.C | Edit statistics box. | |
hist061_TH1_timeonaxis.C | Use a time axis as an x axis. | |
hist062_TH1_timeonaxis2.C | Use a time axis as an x axis and use a time offset. | |
hist063_TH1_seism.C | Use a time axis as an x axis to show sine signal as a strip chart. | |
hist101_TH1_autobinning.C | Fill multiple histograms with different functions and automatic binning. |
Tutorial | Description |
---|---|
hist018_TH2_cutg.C | Use TCutG object to select bins for drawing a region of a 2D histogram. |
hist019_TH2_projection.C | Display a histogram and its two projections. |
hist020_TH2_draw.C | Display 2D histogram drawing options. |
hist021_TH2_reverse_axis.C | Histogram with reverse axis. |
hist022_TH2_palette.C | Automatic placing of a color palette via option COLZ . |
hist102_TH2_contour_list.C | Get contours from a 2D histogram. |
Tutorial | Description |
---|---|
hist103_THnSparse_hist.C | Evaluate the performance of THnSparse vs TH1/2/3/n. |
Tutorial | Description |
---|---|
hist023_THStack_simple.C | Stack histograms with class THStack. |
hist024_THStack_pads.C | Draw stack histograms on subpads. |
hist025_THStack_2d_palette_color.C | Display multiple 2D histograms picking colors within palette 1. |
hist026_THStack_color_scheme.C | Use accessible color schemes with THStack. |
hist027_THStack_palette_color.C | Display multiple 1D histograms picking colors within palette kOcean. |
hist028_THStack_multicolor.C | Use a THStack to show a 2D histogram with cells with different colors. |
Tutorial | Description | |
---|---|---|
hist029_TRatioPlot_simple.C | hist029_TRatioPlot_simple.py | Create a simple ratio plot of two histograms using the pois division option. |
hist030_TRatioPlot_residual.C | hist030_TRatioPlot_residual.py | Create a fit residual plot. |
hist031_TRatioPlot_residual_fit.C | hist031_TRatioPlot_residual_fit.py | Create a fit residual plot and set the y-axis range for it. |
hist032_TRatioPlot_fit_lines.C | hist032_TRatioPlot_fit_lines.py | Set custom dashed lines specified by a vector of floats. |
hist033_TRatioPlot_fit_confidence.C | hist033_TRatioPlot_fit_confidence.py | Set the colors of the confidence interval bands by using |
hist034_TRatioPlot_fit_margin.C | hist034_TRatioPlot_fit_margin.py | Create a fit residual plot, where the separation margin has been set to 0. |
Tutorial | Description |
---|---|
hist037_TH2Poly_boxes.C | Create a histogram with polygonal bins (TH2Poly). |
hist038_TH2Poly_honeycomb.C | Create a histogram with hexagonal bins (TH2Poly). |
hist039_TH2Poly_usa.C | Create a histogram with polygonal bins (TH2Poly). The initial data represent the USA map. |
hist040_TH2Poly_europe.C | Create a histogram with polygonal bins (TH2Poly). The initial data represent the Europe map. |
hist041_TProfile2Poly_realistic.C | Create a histogram with polygonal bins representing different particle charges in a detectior. |
hist042_TProfile2Poly_module_error.C | Create a histogram with polygonal bins simulating a faulty detector panel w.r.t. particle charge. |
hist056_TPolyMarker_contour.C | Make a contour plot and get the first contour in a TPolyMarker. |
hist104_TH2Poly_fibonacci.C | Create a histogram representing the "Fibonacci spiral". |
Tutorial | Description |
---|---|
hist043_Graphics_highlight.C | Use the highlight mechanism to update the title of a histogram in real time. |
hist044_Graphics_highlight2D.C | Use the highlight mechanism to displaying the X and Y projections at a bin in real time. |
hist045_Graphics_highlight_ntuple.C | Use the highlight mechanism to display which events of an ntuple contribute to a bin. |
hist046_Graphics_highlight1D.C | Use the highlight mechanism to zoom on a histogram. |
hist047_Graphics_candle_decay.C | Candle plot illustrating a time development of a certain value. |
hist048_Graphics_candle_hist.C | Illustrate candle plot options. |
hist049_Graphics_candle_plot.C | Create a candle plot with 2-D histograms. |
hist050_Graphics_candle_plot_options.C | Illustrate more candle plot options. |
hist051_Graphics_candle_plot_stack.C | Create a THStack with candle plot option. |
hist052_Graphics_candle_plot_whiskers.C | Create a candle plot showing the whiskers definition. |
hist053_Graphics_candle_scaled.C | Illustrate what scaling effects on candle and violin charts. |
Tutorial | Description | |
---|---|---|
hist057_TExec_th1.C | Echo object at mouse position. | |
hist058_TExec_th2.C | Echo object at mouse position and show a graphics line. | |
hist105_TExec_dynamic_slice.C | hist105_TExec_dynamic_slice.py | Show the slice of a TH2 following the mouse position. |
Files | |
file | greyscale.C |
![]() ![]() ![]() | |
file | hist000_TH1_first.C |
Hello World example for TH1. | |
file | hist000_TH1_first.py |
Hello World example for TH1. | |
file | hist001_TH1_fillrandom.C |
![]() ![]() Fill a 1D histogram with random values using predefined functions. | |
file | hist001_TH1_fillrandom.py |
![]() ![]() Fill a 1D histogram with random values using predefined functions. | |
file | hist002_TH1_fillrandom_userfunc.C |
![]() ![]() Fill a 1D histogram from a user-defined parametric function. | |
file | hist002_TH1_fillrandom_userfunc.py |
![]() ![]() Fill a 1D histogram from a user-defined parametric function. | |
file | hist003_TH1_draw.C |
![]() ![]() ![]() | |
file | hist003_TH1_draw.py |
![]() ![]() Draw a 1D histogram to a canvas. | |
file | hist004_TH1_labels.C |
![]() ![]() ![]() | |
file | hist005_TH1_palettecolor.C |
![]() ![]() ![]() | |
file | hist006_TH1_bar_charts.C |
![]() ![]() ![]() | |
file | hist007_TH1_liveupdate.C |
![]() ![]() ![]() | |
file | hist007_TH1_liveupdate.py |
![]() ![]() Simple example illustrating how to use the C++ interpreter. | |
file | hist008_TH1_zoom.C |
![]() ![]() ![]() | |
file | hist009_TH1_normalize.C |
![]() ![]() ![]() | |
file | hist010_TH1_two_scales.C |
![]() ![]() ![]() | |
file | hist010_TH1_two_scales.py |
![]() ![]() Example of macro illustrating how to superimpose two histograms with different scales in the "same" pad. | |
file | hist011_TH1_legend_autoplaced.C |
![]() ![]() ![]() | |
file | hist012_TH1_hksimple.C |
![]() ![]() ![]() | |
file | hist013_TH1_rebin.C |
![]() ![]() ![]() | |
file | hist014_TH1_cumulative.C |
![]() ![]() ![]() | |
file | hist015_TH1_read_and_draw.C |
![]() ![]() ![]() | |
file | hist015_TH1_read_and_draw.py |
![]() ![]() A Simple histogram drawing example. | |
file | hist016_TH1_different_scales_canvas.C |
![]() ![]() ![]() | |
file | hist017_TH1_smooth.C |
![]() ![]() ![]() | |
file | hist018_TH2_cutg.C |
![]() ![]() ![]() | |
file | hist019_TH2_projection.C |
![]() ![]() ![]() | |
file | hist020_TH2_draw.C |
![]() ![]() ![]() | |
file | hist021_TH2_reverse_axis.C |
![]() ![]() ![]() | |
file | hist022_TH2_palette.C |
![]() ![]() ![]() | |
file | hist023_THStack_simple.C |
![]() ![]() ![]() | |
file | hist024_THStack_pads.C |
![]() ![]() ![]() | |
file | hist025_THStack_2d_palette_color.C |
![]() ![]() ![]() | |
file | hist026_THStack_color_scheme.C |
![]() ![]() ![]() | |
file | hist027_THStack_palette_color.C |
![]() ![]() ![]() | |
file | hist028_THStack_multicolor.C |
![]() ![]() ![]() | |
file | hist029_TRatioPlot_simple.C |
![]() ![]() ![]() | |
file | hist029_TRatioPlot_simple.py |
![]() ![]() Example creating a simple ratio plot of two histograms using the pois division option. | |
file | hist030_TRatioPlot_residual.C |
![]() ![]() ![]() | |
file | hist030_TRatioPlot_residual.py |
![]() ![]() Example of a fit residual plot. | |
file | hist031_TRatioPlot_residual_fit.C |
![]() ![]() ![]() | |
file | hist031_TRatioPlot_residual_fit.py |
![]() ![]() Example which shows how you can get the graph of the lower plot and set the y axis range for it. | |
file | hist032_TRatioPlot_fit_lines.C |
![]() ![]() ![]() | |
file | hist032_TRatioPlot_fit_lines.py |
![]() ![]() Example that shows custom dashed lines on the lower plot, specified by a vector of floats. | |
file | hist033_TRatioPlot_fit_confidence.C |
![]() ![]() ![]() TRatioPlot::SetConfidenceIntervalColors . | |
file | hist033_TRatioPlot_fit_confidence.py |
![]() ![]() Example that shows how you can set the colors of the confidence interval bands by using the method TRatioPlot::SetConfidenceIntervalColors . | |
file | hist034_TRatioPlot_fit_margin.C |
![]() ![]() ![]() | |
file | hist034_TRatioPlot_fit_margin.py |
![]() ![]() Example showing a fit residual plot, where the separation margin has been set to 0. | |
file | hist036_TH2_labels.C |
![]() ![]() ![]() | |
file | hist037_TH2Poly_boxes.C |
![]() ![]() This tutorial illustrates how to create an histogram with polygonal bins (TH2Poly). | |
file | hist038_TH2Poly_honeycomb.C |
![]() ![]() ![]() | |
file | hist039_TH2Poly_usa.C |
![]() ![]() ![]() col option. | |
file | hist040_TH2Poly_europe.C |
![]() ![]() This tutorial illustrates how to create an histogram with polygonal bins (TH2Poly), fill it and draw it. | |
file | hist041_TProfile2Poly_realistic.C |
![]() ![]() ![]() | |
file | hist042_TProfile2Poly_module_error.C |
![]() ![]() ![]() | |
file | hist043_Graphics_highlight.C |
This tutorial demonstrates how the highlight mechanism can be used on an histogram. | |
file | hist044_Graphics_highlight2D.C |
This tutorial demonstrates how the highlight mechanism can be used on an histogram. | |
file | hist045_Graphics_highlight_ntuple.C |
This tutorial demonstrates how the highlight mechanism can be used on a ntuple. | |
file | hist046_Graphics_highlight1D.C |
This tutorial demonstrates how the highlight mechanism can be used on an histogram. | |
file | hist047_Graphics_candle_decay.C |
![]() ![]() ![]() | |
file | hist048_Graphics_candle_hist.C |
![]() ![]() ![]() | |
file | hist049_Graphics_candle_plot.C |
![]() ![]() ![]() | |
file | hist050_Graphics_candle_plot_options.C |
![]() ![]() ![]() | |
file | hist051_Graphics_candle_plot_stack.C |
![]() ![]() ![]() | |
file | hist052_Graphics_candle_plot_whiskers.C |
![]() ![]() ![]() | |
file | hist053_Graphics_candle_scaled.C |
![]() ![]() ![]() | |
file | hist056_TPolyMarker_contour.C |
![]() ![]() Make a contour plot and get the first contour in a TPolyMarker. | |
file | hist057_TExec_th1.C |
Echo object at mouse position. | |
file | hist058_TExec_th2.C |
Echo object at mouse position and show a graphics line. | |
file | hist060_TH1_stats.C |
![]() ![]() ![]() | |
file | hist061_TH1_timeonaxis.C |
![]() ![]() ![]() | |
file | hist062_TH1_timeonaxis2.C |
![]() ![]() ![]() | |
file | hist063_TH1_seism.C |
![]() ![]() ![]() | |
file | hist101_TH1_autobinning.C |
![]() | |
file | hist102_TH2_contour_list.C |
![]() ![]() ![]() | |
file | hist103_THnSparse_hist.C |
Evaluate the performance of THnSparse vs TH1/2/3/nF for different numbers of dimensions and bins per dimension. | |
file | hist104_TH2Poly_fibonacci.C |
![]() ![]() ![]() | |
file | hist105_TExec_dynamic_slice.C |
![]() ![]() ![]() | |
file | hist105_TExec_dynamic_slice.py |
![]() ![]() Example of function called when a mouse event occurs in a pad. | |