plotAddHist#
Purpose#
Adds a histogram to an existing graph.
Format#
- plotAddHist([myPlot, ]x, v)#
- Parameters:
myPlot (struct) – Optional argument. A
plotControlstructure.x (Mx1 vector) – data
v (Nx1 vector or scalar) –
Type
Value
vector
the breakpoints to be used to compute the frequencies.
scalar
the number of categories.
Remarks#
plotAddHist() may only add a histogram to 2-D graphs.
This function will not change any of the current graph’s settings other than to resize the view as necessary to display the new curve.
Examples#
// Create two sets of random data
x1 = rndn(500, 1);
x2 = rndn(500, 1) + 2;
// Plot first histogram with 20 bins
plotHist(x1, 20);
// Add second histogram to same graph
plotAddHist(x2, 20);
See also
Functions plotAddBar(), plotAddHistF(), plotAddHistP(), plotAddPolar(), plotAddXY()