matlab的画图工具包gramm


如题所示,这是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@grammaxe_property.m
     文件         876  2018-03-06 14:57  gramm-master@grammcoord_flip.m
     文件       56923  2018-03-06 14:57  gramm-master@grammdraw.m
     文件        3760  2018-03-06 14:57  gramm-master@grammexport.m
     文件        2828  2018-03-06 14:57  gramm-master@grammfacet_grid.m
     文件        1694  2018-03-06 14:57  gramm-master@grammfacet_wrap.m
     文件         423  2018-03-06 14:57  gramm-master@grammfig.m
     文件         777  2018-03-06 14:57  gramm-master@grammgeom_abline.m
     文件        4198  2018-03-06 14:57  gramm-master@grammgeom_bar.m
     文件        1278  2018-03-06 14:57  gramm-master@grammgeom_count.m
     文件         529  2018-03-06 14:57  gramm-master@grammgeom_funline.m
     文件         510  2018-03-06 14:57  gramm-master@grammgeom_hline.m
     文件        1228  2018-03-06 14:57  gramm-master@grammgeom_interval.m
     文件        1920  2018-03-06 14:57  gramm-master@grammgeom_jitter.m
     文件        2147  2018-03-06 14:57  gramm-master@grammgeom_label.m
     文件        4932  2018-03-06 14:57  gramm-master@grammgeom_line.m
     文件        3469  2018-03-06 14:57  gramm-master@grammgeom_point.m
     文件        4439  2018-03-06 14:57  gramm-master@grammgeom_polygon.m
     文件        2228  2018-03-06 14:57  gramm-master@grammgeom_raster.m
     文件         505  2018-03-06 14:57  gramm-master@grammgeom_vline.m
     文件       10255  2018-03-06 14:57  gramm-master@grammgramm.m
     文件         182  2018-03-06 14:57  gramm-master@gramm
o_legend.m
     目录           0  2018-03-06 14:57  gramm-master@grammprivate
     文件        1709  2018-03-06 14:57  gramm-master@grammprivateLICENSE ColorBrewer.txt
     文件         331  2018-03-06 14:57  gramm-master@grammprivatecomb.m
     文件         671  2018-03-06 14:57  gramm-master@grammprivatecombnan.m
     文件        2691  2018-03-06 14:57  gramm-master@grammprivatedodge_comp.m
     文件         546  2018-03-06 14:57  gramm-master@grammprivatedodger.m
............此处省略107个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)