Maxima Function
histogram (list)
histogram(list,option_1,option_2,...)
histogram(one_column_matrix)
histogram(one_column_matrix,option_1,option_2,...)
This function plots an histogram. Sample data must be stored in a list of numbers or a one column matrix. Giving values to the following options some aspects of the plot can be controlled:
'outputdev
, default "x"
, indicates the output device; correct values are "x"
, "eps"
and "png"
, for the screen, postscript and png format files, respectively.
'maintitle
, default ""
, is the main title between double quotes.
'axisnames
, default ["x", "Fr."]
, is a list with the names of axis x
and y
.
'picturescales
, default [1.0, 1.0]
, scaling factors for the size of the plot.
'nclasses
, default 10
, is the number of classes or bars.
'relbarwidth
, default 0.9
, a decimal number between 0 and 1 to control bars width.
'barcolor
, default 1
, an integer to indicate bars color.
'colorintensity
, default 1
, a decimal number between 0 and 1 to fix color intensity.
In the next two examples, histograms are requested for the first 100 digits of number %pi
and for the wind speeds in the third meteorological station.
(%i1) load (descriptive)$ (%i2) load (numericalio)$ (%i3) s1 : read_list (file_search ("pidigits.data"))$ (%i4) histogram (s1, 'maintitle = "pi digits", 'axisnames = ["", "Absolute frequency"], 'relbarwidth = 0.2, 'barcolor = 3, 'colorintensity = 0.6)$ (%i5) s2 : read_matrix (file_search ("wind.data"))$ (%i6) histogram (col (s2, 3), 'colorintensity = 0.3)$
Note that in the first case, s1
is a list and in the second example, col(s2,3)
is a matrix.