• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Airboy1
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 下一页

2018年8月25日

绘制针状图
摘要: t=[0:0.5:25]; y=exp(-t/3)+sin(1+2*t); h=stem(t,y,'--'); set(get(h,'baseline'),'linestyle',':'); %把水平轴设置成: 的形状 set(h,'markerfacecolor','yellow'); hold on t2=[0:0.1:25]; y2=exp(-t2/3)+sin(1+2*t2); p... 阅读全文
posted @ 2018-08-25 20:16 Airboy1 阅读(576) 评论(0) 推荐(0)
 
绘制矢量图
摘要: n=-2:0.2:2; [x,y,z]=peaks(n); %绘制peaks 三维曲线,并用 x y z 存储 [u,v]=gradient(z); %求各各点的在水平方向和竖直方向的梯度 quiver(x,y,u,v); %绘制矢量图 hold on contour(x,y,z,10) % 设置等高线的根数(画出来有n根等高线) 阅读全文
posted @ 2018-08-25 19:49 Airboy1 阅读(491) 评论(0) 推荐(0)
 
饼图pie 或者pie3
摘要: %% pie(x,explode),explode 是一个与x同纬的矩阵,非0 时 使对应的部分突出 x=[1 2.5 1.8 3.6 2.4]; subplot(221);pie(x,1:5,{'Dep1','Dep2','Dep3','Dep4','Dep5'}); subplot(222);pie(x); subplot('Position',[0.2,0.05,0.6,0.45]); ... 阅读全文
posted @ 2018-08-25 19:30 Airboy1 阅读(355) 评论(0) 推荐(0)
 
三维直方图
摘要: Y=cool(8); subplot(221);bar3(Y,'detached');title('Detached'); subplot(222);bar3(Y,'grouped');title('Grouped'); subplot(223);bar3(Y,'stacked');title('Stacked'); subplot(224);bar3(Y,0.3,'stacked');titl... 阅读全文
posted @ 2018-08-25 19:19 Airboy1 阅读(317) 评论(0) 推荐(0)
 
直方图
摘要: %% bar bar3 竖直 bar( ,'style') group 默认,stack 堆叠 Income=[0.5,0.7,0.8;0.7,0.8,0.4;0.4,0.3,0.9;0.3,0.6,0.9;0.2,0.1,0.6]; subplot(221) bar(Income,'group');title('group') subplot(222) bar(Income,'stac... 阅读全文
posted @ 2018-08-25 16:55 Airboy1 阅读(228) 评论(0) 推荐(0)
 
面积图
摘要: y=[2 ,4,5; 3,1,9; 5,3,5; 2,6,1] area(y) %第一列绘图;第一列加第二列绘图;第一列加第二列加第三列绘图; grid on colormap summer % 设置当前图层的颜色 set(gca,'layer','top') %将面积图的图层设置为最顶层 阅读全文
posted @ 2018-08-25 14:40 Airboy1 阅读(295) 评论(0) 推荐(0)
 
ezplot (fplot见matlab 宝典)
摘要: %% ezplot 无需指定自变量的范围 syms t % 将 t 设置为符号变量 y=3/4*(exp(-2*t/3)*sin(1+2*t)); ezplot(y,[pi,3*pi]); 阅读全文
posted @ 2018-08-25 09:33 Airboy1 阅读(842) 评论(0) 推荐(0)
 
绘制动态
摘要: axis([0 10 0 10]); hold on xy=[]; n=0; disp('Left mouse button picks points') disp('Right mouse button picks last point') but=1; while but==1 [xi,yi,but]=ginput(1); plot(xi,yi,'ro') n=n+... 阅读全文
posted @ 2018-08-25 09:15 Airboy1 阅读(191) 评论(0) 推荐(0)
 
subplot 设置不一样的图片大小和位置
摘要: t=[0:0.1:25]; y1=exp(-t/3); y3=sin(2*t+3); y2=log(t+1); subplot(2,2,1) plot(t,y1,'linewidth',2) subplot(2,2,2) plot(t,y2,'linewidth',2) % subplot(2,2,[3,4]) % 可以这样设置 一张图占多张图的位置 subplot('position',... 阅读全文
posted @ 2018-08-25 08:29 Airboy1 阅读(4643) 评论(0) 推荐(0)
 
绘制双坐标轴的图形
摘要: %[AX,H1,H2]=plotyy(...):返回AX中创建的两个坐标轴的句柄以及H1和H2中每个图形绘图对象的句柄。AX(1)为左侧轴,AX(2)为右侧轴。 x = 0:0.01:20; y1 = 200*exp(-0.05*x).*sin(x); y2 = 0.8*exp(-0.5*x).*sin(10*x); figure % new figure [hAx,hLine1,hLine... 阅读全文
posted @ 2018-08-25 08:14 Airboy1 阅读(405) 评论(0) 推荐(0)
 
 
上一页 1 2 3 4 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3