MATLAB强大的线条与渐变颜色设置..docx

MATLAB强大的线条与渐变颜色设置..docx

  1. 1、本文档共5页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
1 渐变1.1t=[linspace(0,2*pi) nan];x=sin(t);y=cos(2*t);z=sqrt(t);%所要绘制的曲线方程patch(x,y,z,z,edgecolor,flat,facecolor,none)view(3);grid on;colorbar1.2x=-200:5:200;y=-200:5:200;z=-200:5:200;m=linspace(0,1,length(x));for i=1:length(x);plot3(x(i),y(i),z(i),o,color,[m(i) 0 0])hold onend1.3 柱状图填色Matlab绘制彩色柱状图?(2012-09-28 12:58:34)转载▼标签:?彩色柱状图?杂谈分类:?Matlab首先,看一下效果图。默认条件下的柱状图颜色均为蓝色,现在可以绘制漂亮的柱状图以及渐变着色的柱状图。% 彩色柱状图%% 用到的数据n =?13;Z =?rand(n,1);%% 默认图片bar(Z);%% 简单的作图% 这个图根据数据列中值的大小着色。每列中的% 值越大,颜色越突出figureh=bar(Z);colormap(summer(n));ch =?get(h,Children);fvd =?get(ch,Faces);fvcd =?get(ch,FaceVertexCData);[~, izs]?=?sortrows(Z,1);for?i?=?1:nrow = izs(i);fvcd(fvd(row,:))?=?i;endset(ch,FaceVertexCData,fvcd)%% 更加漂亮的图片% 图片会以渐变的方式着色,效果非常不错figureh=bar(Z);ch =?get(h,Children);fvd =?get(ch,Faces);fvcd =?get(ch,FaceVertexCData);[zs, izs]?=?sortrows(Z,1);k =?128;?% 准备生成128 *3 行的colormapcolormap(summer(k));?% 这样会产生一个128 * 3的矩阵,分别代表[R G B]的值% 检视数据whos?ch fvd fvcd zs izs%%???Name???????Size????????????Bytes??Class?????Attributes%%???ch?????????1x1?????????????????8??double%???fvcd??????66x1???????????????528??double%???fvd???????13x4???????????????416??double%???izs???????13x1???????????????104??double%???zs????????13x1???????????????104??double%shading?interp?% Needed to graduate colorsfor?i?=?1:ncolor =?floor(k*i/n);?% 这里用取整函数获得color在colormap中行row = izs(i);?% Look up actual row # in datafvcd(fvd(row,1))?=?1;?% Color base vertices 1st indexfvcd(fvd(row,4))?=?1;fvcd(fvd(row,2))?= color;?% Assign top vertices colorfvcd(fvd(row,3))?= color;endset(ch,FaceVertexCData, fvcd);?% Apply the vertex coloringset(ch,EdgeColor,k)2 符号/线型/颜色/绘图标记 b blue . point - solid g green o circle : dotted r red x x-mark -. dashdot c cyan + plus -- dashed m magenta * star (none) no line y yellow s square k black d diamond

文档评论(0)

tiangou + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档