|
楼主这么感兴趣,试试:
x = -4:.5:4;
y = randn(10000,1);
hist(y,x)
然后在figure中编辑,
效果图:
选择file-->generate M file...,生成文件:
function createfigure1(VertexNormals1, YData1, XData1, Vertices1, Faces1, FaceVertexCData1, CData1)
%CREATEFIGURE1(VERTEXNORMALS1,YDATA1,XDATA1,VERTICES1,FACES1,FACEVERTEXCDATA1,CDATA1)
% VERTEXNORMALS1: patch vertexnormals
% YDATA1: patch ydata
% XDATA1: patch xdata
% VERTICES1: patch vertices
% FACES1: patch faces
% FACEVERTEXCDATA1: patch facevertexcdata
% CDATA1: patch cdata
% Auto-generated by MATLAB on 22-Nov-2010 20:06:35
% Create figure
figure1 = figure('PaperSize',[20.98 29.68]);
% Create axes
axes1 = axes('Visible','off','Parent',figure1,'CLim',[1 2]);
box('on');
% Create patch
patch('Parent',axes1,'VertexNormals',VertexNormals1,'YData',YData1,...
'XData',XData1,...
'Vertices',Vertices1,...
'Faces',Faces1,...
'FaceColor','flat',...
'FaceVertexCData',FaceVertexCData1,...
'DisplayName','y',...
'CData',CData1);
% Create line
annotation(figure1,'line',[0.1918 0.1906],[0.06515 0.08366]);
% Create line
annotation(figure1,'line',[0.8459 0.8459],[0.06709 0.08755]);
% Create line
annotation(figure1,'line',[0.1918 0.8471],[0.08655 0.08755]);
% Create line
annotation(figure1,'line',[0.5353 0.5365],[0.06515 0.0856]);
% Create textbox
annotation(figure1,'textbox',[0.5259 0.01696 0.03176 0.04475],...
'String',{'0'},...
'FitBoxToText','off',...
'EdgeColor',[0.8 0.8 0.8]);
% Create textbox
annotation(figure1,'textbox',[0.8341 0.01502 0.03176 0.04475],...
'String',{'5'},...
'FitBoxToText','off',...
'EdgeColor',[0.8 0.8 0.8]);
% Create line
annotation(figure1,'line',[0.1835 0.1835],[0.8901 0.1245]);
% Create line
annotation(figure1,'line',[0.1659 0.1835],[0.1284 0.1284]);
% Create line
annotation(figure1,'line',[0.1635 0.1812],[0.8886 0.8886]);
% Create line
annotation(figure1,'line',[0.1635 0.1812],[0.5131 0.5131]);
% Create textbox
annotation(figure1,'textbox',[0.1753 0.02529 0.03176 0.04475],...
'String',{'-5'},...
'FitBoxToText','off',...
'EdgeColor',[0.8 0.8 0.8]);
% Create textbox
annotation(figure1,'textbox',[0.1318 0.1065 0.03176 0.04475],'String',{'0'},...
'FitBoxToText','off',...
'EdgeColor',[0.8 0.8 0.8]);
% Create textbox
annotation(figure1,'textbox',[0.1153 0.4897 0.03176 0.04475],...
'String',{'1000'},...
'FitBoxToText','off',...
'EdgeColor',[0.8 0.8 0.8]);
% Create textbox
annotation(figure1,'textbox',[0.1188 0.8672 0.03176 0.04475],...
'String',{'2000'},...
'FitBoxToText','off',...
'EdgeColor',[0.8 0.8 0.8]);
但是这个函数要自己输入参数,倒是很不方便...
|
评分
-
1
查看全部评分
-
|