scatter用来画散点图,而hist系列的函数是用来画直方图,具体应用可以在官网上找到。
要想把散点图和直方图结合起来,可以用scatterhist函数。
其中,用法如下:
scatterhist(x,y)
h = scatterhist(...)
scatterhist(...,'param1',val1,'param2',val2,...)
注意:x和y必须所含元素个数相同,即维数相同
参数可以有以下三种:
'NBins' — A scalar or a two-element vector
specifying the number of bins for the X and Y
histograms. The default is to compute the number of bins using
Scott's rule based on the sample standard deviation.
'Location' — A string controlling the location of the
marginal histograms within the figure. 'SouthWest' (the
default) plots the histograms below and to the left of the
scatterplot, 'SouthEast' plots them below and to the
right, 'NorthEast' above and to the right, and
'Nort