资源简介
如题所示,这是matlab的仿R风格的画图工具包,里面带有教程.
代码片段和文件信息
%% gramm examples and how-tos
%% Example from the readme
% Here we plot the evolution of fuel economy of new cars bewteen 1970 and 1980 (carbig
% dataset). Gramm is used to easily separate groups on the basis of the number of
% cylinders of the cars (color) and on the basis of the region of origin of
% the cars (subplot columns). Both the raw data (points) and a glm fit with
% 95% confidence interval (line+shaded area) are plotted.
%
% We stat by loading the sample data (structure created from the carbig
% dataset)
load example_data;
%%%
% Create a gramm object provide x (year of production) and y (fuel economy) data
% color grouping data (number of cylinders) and select a subset of the data
g=gramm(‘x‘cars.Model_Year‘y‘cars.MPG‘color‘cars.Cylinders‘subset‘cars.Cylinders~=3 & cars.Cylinders~=5);
%%%
% Subdivide the data in subplots horizontally by region of origin using
% facet_grid()
g.facet_grid([]cars.Origin_Region);
%%%
% Plot raw data as points
g.geom_point();
%%%
% Plot linear fits of the data with associated confidence intervals
g.stat_glm();
%%%
% Set appropriate names for legends
g.set_names(‘column‘‘Origin‘‘x‘‘Year of production‘‘y‘‘Fuel economy (MPG)‘‘color‘‘# Cylinders‘);
%%%
% Set figure title
g.set_title(‘Fuel economy of new cars between 1970 and 1982‘);
%%%
% Do the actual drawing
figure(‘Position‘[100 100 800 400]);
g.draw();
%% Grouping options in gramm
% With gramm there are a lot ways to map groups to visual properties of
% plotted data or even subplots.
% Providing grouping variables to change visual properties is done in the
% constructor call |gramm()|. Grouping variables that determine subplotting
% are provided by calls to the |facet_grid()| or |facet_wrap()| methods.
% Note that *all the mappings presented below can be combined* i.e. it‘s
% possible to previde different variables to each of the options.
%
% In order to plot multiple diferent gramm objects in the same figure an array of gramm objects
% is created and the |draw()| function called at the end on the whole array
clear g
g(11)=gramm(‘x‘cars.Horsepower‘y‘cars.MPG‘subset‘cars.Cylinders~=3 & cars.Cylinders~=5);
g(11).geom_point();
g(11).set_names(‘x‘‘Horsepower‘‘y‘‘MPG‘);
g(11).set_title(‘No groups‘);
g(12)=gramm(‘x‘cars.Horsepower‘y‘cars.MPG‘subset‘cars.Cylinders~=3 & cars.Cylinders~=5‘color‘cars.Cylinders);
g(12).geom_point();
g(12).set_names(‘x‘‘Horsepower‘‘y‘‘MPG‘‘color‘‘# Cyl‘);
g(12).set_title(‘color‘);
g(13)=gramm(‘x‘cars.Horsepower‘y‘cars.MPG‘subset‘cars.Cylinders~=3 & cars.Cylinders~=5‘lightness‘cars.Cylinders);
g(13).geom_point();
g(13).set_names(‘x‘‘Horsepower‘‘y‘‘MPG‘‘lightness‘‘# Cyl‘);
g(13).set_title(‘lightness‘);
g(21)=gramm(‘x‘cars.Horsepower‘y‘cars.MPG‘subset‘cars.Cylinders~=3 & cars.Cylinders~=5‘size‘cars.Cylinders);
g(21).geom_point();
g(21).set_names(‘x‘‘Horsepower‘‘y‘‘MPG‘‘size‘‘# Cyl‘);
g(21).set_title(‘size‘);
g(22)=gramm(‘x‘cars.Horsepower‘y‘
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-06 14:57 gramm-master\
文件 50 2018-03-06 14:57 gramm-master\.gitignore
目录 0 2018-03-06 14:57 gramm-master\@gramm\
文件 611 2018-03-06 14:57 gramm-master\@gramm\axe_property.m
文件 876 2018-03-06 14:57 gramm-master\@gramm\coord_flip.m
文件 56923 2018-03-06 14:57 gramm-master\@gramm\draw.m
文件 3760 2018-03-06 14:57 gramm-master\@gramm\export.m
文件 2828 2018-03-06 14:57 gramm-master\@gramm\facet_grid.m
文件 1694 2018-03-06 14:57 gramm-master\@gramm\facet_wrap.m
文件 423 2018-03-06 14:57 gramm-master\@gramm\fig.m
文件 777 2018-03-06 14:57 gramm-master\@gramm\geom_abline.m
文件 4198 2018-03-06 14:57 gramm-master\@gramm\geom_bar.m
文件 1278 2018-03-06 14:57 gramm-master\@gramm\geom_count.m
文件 529 2018-03-06 14:57 gramm-master\@gramm\geom_funline.m
文件 510 2018-03-06 14:57 gramm-master\@gramm\geom_hline.m
文件 1228 2018-03-06 14:57 gramm-master\@gramm\geom_interval.m
文件 1920 2018-03-06 14:57 gramm-master\@gramm\geom_jitter.m
文件 2147 2018-03-06 14:57 gramm-master\@gramm\geom_label.m
文件 4932 2018-03-06 14:57 gramm-master\@gramm\geom_line.m
文件 3469 2018-03-06 14:57 gramm-master\@gramm\geom_point.m
文件 4439 2018-03-06 14:57 gramm-master\@gramm\geom_polygon.m
文件 2228 2018-03-06 14:57 gramm-master\@gramm\geom_raster.m
文件 505 2018-03-06 14:57 gramm-master\@gramm\geom_vline.m
文件 10255 2018-03-06 14:57 gramm-master\@gramm\gramm.m
文件 182 2018-03-06 14:57 gramm-master\@gramm\no_legend.m
目录 0 2018-03-06 14:57 gramm-master\@gramm\private\
文件 1709 2018-03-06 14:57 gramm-master\@gramm\private\LICENSE ColorBrewer.txt
文件 331 2018-03-06 14:57 gramm-master\@gramm\private\comb.m
文件 671 2018-03-06 14:57 gramm-master\@gramm\private\combnan.m
文件 2691 2018-03-06 14:57 gramm-master\@gramm\private\dodge_comp.m
文件 546 2018-03-06 14:57 gramm-master\@gramm\private\dodger.m
............此处省略107个文件信息
相关资源
- 虹膜识别+源代码+matlab+霍夫变换+hou
- 人脸检测matlab编写
- map match matlab
- GVFSnake(matlab)边缘检测和图像分割
- 波束形成Matlab程序218509
- 贝叶斯网络Matlab源代码
- ADAMS与MATLAB联合仿真模拟曲柄摇杆机构
- 基于信息熵的约简MATLAB代码
- 任玉杰《数值分析及其MATLAB实现》所
- 流形学习LLE源代码matlab编写
- 无线传感器网络节点定位算法matlab源
- 自控实验报告
- 谱聚类算法对数据点进行分类
- 基于MATLAB的16QAM仿真代码
- 基于Matlab的IR-UWB无线通信信道模型仿
- 最优化方法及其MATLAB程序设计
- BP车牌检测.zip
- 各种最小二乘法总结算法+matlab源码
- MATLAB的SVM安装包drtoolbox_libsvm-3.17
- 在matlab下调用kinectv2的完整功能
- matlab子空间聚类
- 图像去除干扰条纹
- 模糊车牌识别
- MATLAB程序设计与应用(刘卫国编)课
- 高光谱图像在matlab里的读入与显示
- matlab-bgl 4.0.1
- MATLAB聚类分析工具箱
- matlab robotics toolbox
- SVM算法对MNIST数据集分类
- 鱼雷控制系统计算机辅助分析设计与
评论
共有 条评论