使用MATLAB用hist画了直方图加一条竖线作为参考线

来自https://zhidao.baidu.com/question/2010891127787818868.html

x=normrnd(10,0.1,1,1000); 
hist(x,50)
hold on;
plot([10 10], get(gca, 'YLim'), '-r', 'LineWidth', 1) % 在x=10处加一条红色,宽度为1竖线
%get(gca, 'YLim')返回y轴最大最小值

猜你喜欢

转载自www.cnblogs.com/litthorse/p/9320969.html
今日推荐