漂亮,美观的图表之Matlab强势回归~~~~走你7

ex1

load timeseriesAnalysis;
y_detrended1 = detrend(ydata1); 
y_detrended2 = detrend(ydata2); 
subplot(2,1,1);plot(x, ydata1,'-',x, ydata1-y_detrended1,'r');title('Detrended Signal 1');


detrend 用法详见help.

 

ex2 如何使用scatter:

[attrib className] = xlsread('iris.xlsx');

%% basic scatter plot
figure('units','normalized','Position',[0.2359    0.3009    0.4094    0.6037]);
scatter(attrib(:,1),attrib(:,2),10*attrib(:,3),[1 0 0],'filled','Marker','^');
set(gca,'Fontsize',12);
title({'The Fisher Iris dataset (shown here) has 150 samples, with 4 attribute dimensions',...    
    'A scaled version of attribute 3 is used to determine the size of the marker',...
    'Customizations include user-defined marker style and face color'});
xlabel('Attribute 1'); ylabel('Attribute 2');
box on;
set(gcf,'color',[1 1 1],'paperpositionmode','auto');


 

 

ex3:

%% plot matrix
% The output parameters have 
% A matrix of handles to the objects created in H, 
% A matrix of handles to the individual subaxes in AX, 
% A handle to a big (invisible) axes that frames the subaxes in BigAx, 
% A matrix of handles for the histogram plots in P. BigAx is left as the current axes so that a subsequent title, xlabel, or ylabel command is centered with respect to the matrix of axes.
figure('units','normalized','Position',[ 0.2359    0.3009    0.4094    0.6037]);
[H,AX,BigAx,P] = plotmatrix(attrib,'r.');
attribName = {[char(10) 'Sepal length'],[char(10) 'Sepal width'],[char(10) 'Petal length'],[char(10) 'Petal width']};
% add annotations
for i = 1:4
    set(get(AX(i,1),'ylabel'),'string',['Attribute ' num2str(i) attribName{i}]); 
    set(get(AX(4,i),'xlabel'),'string',['Attribute ' num2str(i) attribName{i}]);
end
set(get(BigAx,'title'),'String',{'Scatter Plot Matrix (Fisher dataset with 3 known classes of iris flowers)', ...
    'Figure shows the 3 classes are not separable based on any two dimensions'},'Fontsize',14);
set(gcf,'color',[1 1 1],'paperpositionmode','auto');


 今天总结的很简单,就几个函数的用法。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值