📄 emplot.m
字号:
function c=emplot(data,axs),
%Plots empirical distribution of a sample.
%
%USAGE: emplot(data,axs)
%
% data: Data vector
% axs: Can be 'lin', 'x' or not entered
% if not entered: Log scaling on both axes
% if 'lin': Linear scaling on both axes
% if 'x': Log scaling on x axis
warning off
if nargin==1,
axs='both';
end
if strcmp(axs,'both')|strcmp(axs,'x'),
disp(' If there are negative values in the data, they will be omitted while taking logarithm');
end
data=sort(data);
ypoints=1-ppoints(data);
if strcmp(axs,'lin'),
plot(data,ypoints,'.');
xlabel('x');
ylabel('1-F(x)');
elseif strcmp(axs,'x')
semilogx(data,ypoints,'.')
set(gca,'xticklabel',get(gca,'xtick'));
set(gca,'xtickmode','manual');
xlabel('x (on log scale)');
xlabel('x (on log scale)');
ylabel('1-F(x)');
elseif strcmp(axs,'both')
loglog(data,ypoints,'.')
set(gca,'yticklabel',get(gca,'ytick'));
set(gca,'ytickmode','manual');
set(gca,'xticklabel',get(gca,'xtick'));
set(gca,'xtickmode','manual');
xlabel('x (on log scale)');
ylabel('1-F(x) (on log scale)');
else
disp('ERROR: Second input should be one of {''lin'',''x'',''both''} ')
return
end
set(gca,'fontsize',8);
warning on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -