histf

版本 1.0.0.0 (62.4 KB) 作者: Chad Greene
Simply produce histograms formatted the way you like them.
4.9K 次下载
更新时间 2014/8/15

查看许可证

This function plots formatted histograms. It's similar to hist, but with more options for FaceColor, BarWidth, LineStyle, FaceAlpha, etc.

Syntax
histf(Y)
histf(Y,x)
histf(Y,nbins)
histf(...,'BarWidth',BarWidth)
histf(...,'FaceColor',FaceColor)
histf(...,'EdgeColor',EdgeColor)
histf(...,'LineStyle',LineStyle)
histf(...,'LineWidth',LineWidth)
histf(...,'FaceAlpha',FaceAlpha)
histf(...,'EdgeAlpha',EdgeAlpha)
histf(...,'Alpha',Alpha)
[n,xout,h] = histf(...)

Description
histf(Y) bins the elements in vector Y into 10 equally spaced containers and returns the number of elements in each container as a row vector. If Y is an m-by-p matrix, histf treats the columns of Y as vectors. No elements of Y can be complex or of type integer.

histf(Y,x) where x is a vector, returns the distribution of Y among length(x) bins with centers specified by x. For example, if x is a 5-element vector, histf distributes the elements of Y into five bins centered on the x-axis at the elements in x, none of which can be complex.

histf(Y,nbins) where nbins is a scalar, uses nbins number of bins.

histf(...,'BarWidth',BarWidth) specifies the width of bars as a fraction of total space available for each bar. Default BarWidth is 1.

histf(...,'FaceColor',FaceColor) specifies face color as a short name, long name, or RGB triple.

histf(...,'EdgeColor',EdgeColor) specifies edge coloras a short name, long name, or RGB triple.

histf(...,'LineStyle',LineStyle) specifies line style of bar edges. Can be '-' (default), ':', '--', '-.', or 'none'.

histf(...,'LineWidth',LineWidth) specifies line width of bar edge in points. Default LineWidth is 0.5 points.

histf(...,'FaceAlpha',FaceAlpha) specifies transparency value of bar faces. FaceAlpha must be a scalar between 0 and 1. Default value is 1.

histf(...,'EdgeAlpha',EdgeAlpha) specifies transparency value of bar edges. EdgeAlpha must be a scalar between 0 and 1. Default value is 1.

histf(...,'Alpha',Alpha) sets FaceAlpha and EdgeAlpha to Alpha.

[n,xout,h] = histf(...) returns vectors n and xout containing the frequency counts and the bin locations. h is the handle of the newly plotted histogram.

引用格式

Chad Greene (2026). histf (https://ww2.mathworks.cn/matlabcentral/fileexchange/47552-histf), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Distribution Plots 的更多信息
致谢

参考作品: legalpha

histf_documentation/html/

版本 已发布 发行说明
1.0.0.0