Compute and draw feature histograms (for groups of samples)
This is a convenience wrapper around matplotlib’s hist() function. It supports it entire API, but data is taken from an input dataset. In addition, feature histograms for groups of dataset samples can be drawn as an array of subplots. Using xgroup_attr and ygroup_attr up to two sample attributes can be selected and samples groups are defined by their unique values. For example, plotting histograms for all combinations of targets and chunks attribute values in a dataset is done by this code:
>>> from mvpa2.viz import hist
>>> from mvpa2.misc.data_generators import normal_feature_dataset
>>> ds = normal_feature_dataset(10, 3, 10, 5)
>>> plots = hist(ds, ygroup_attr='targets', xgroup_attr='chunks',
... noticks=None, xlim=(-.5,.5), normed=True)
>>> len(plots)
15
This function can also be used with plain arrays, in which case it will fall back on the behavior of matplotlib’s hist() and additional functionality is not available.
Parameters: | dataset : Dataset or array xgroup_attr : string, optional
ygroup_attr : None or string, optional
xlim : None or 2-tuple, optional
ylim : None or 2-tuple, optional
noticks : bool or None, optional
**kwargs :
|
---|---|
Returns: | list :
|