--- myst: substitutions: bloc: python: 14-20,26-35 cpp: 5-8,14-16,22-27 --- # Histogram The histogram is present in {{root}} but it needs to be encapsulated when the user wants to choose an automatic method determining the number of **bins**. By default, the number of bins is given in the variable of the configuration file of {{root}} `.rootrc` of the directory `$ROOTSYS/etc`. This information can be overloaded by an user file `.rootrc` in its *home directory ($HOME)*, or in a local file where {{root}} is executed. Several methods exist to determine the number of "bins" according to the characteristics of the variable to be visualised. Again we consider the {{tds}} built from the `geyser.dat` file, to which we add the attribute *xnorm*, then the histograms will be plotted using the different methods of this new attribute. {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/vizualisation/" + language + "/draw_geyser_histograms." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc[language] + "\n" + "```" }} {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/dataserver/vizualisation/" + language + "/geyser_1/geyser_histograms.png\n" ":align: center\n" ":name: dataserver_geyser_histograms\n" + figure_scale + "\n" "\n" "Different histograms of the same attribute *xnorm* depending on the method for computing bins. The values are respectively 100(root), 8 from sturges, 7 from fd and scoot.\n" "```" }}