VisualTest_DrawHistogram

(Source code, png, hires.png, pdf)

../../_images/VisualTest_DrawHistogram.png
VisualTest_DrawHistogram(*args)

Draw an histogram.

Available usages:

VisualTest.DrawHistogram(sample)

VisualTest.DrawHistogram(sample, barsNumber)

Parameters:

sample : 2-d sequence of float

Sample to draw.

barsNumber : positive int

Number of barplots used to draw the histogram. If not specified, it is automatically determined by OpenTURNS according to the Silverman rule.

Returns:

graph : class:~openturns.Graph

The graph object

Examples

>>> import openturns as ot
>>> from openturns.viewer import View

Generate a random sample from a Normal distribution:

>>> ot.RandomGenerator.SetSeed(0)
>>> sample = ot.Normal(1).getSample(100)

Draw an histogram:

>>> hist = ot.VisualTest.DrawHistogram(sample)
>>> View(hist).show()