Matlab坐设置.docx

上传人:小飞机 文档编号:3161294 上传时间:2023-03-11 格式:DOCX 页数:10 大小:39.26KB
返回 下载 相关 举报
Matlab坐设置.docx_第1页
第1页 / 共10页
Matlab坐设置.docx_第2页
第2页 / 共10页
Matlab坐设置.docx_第3页
第3页 / 共10页
Matlab坐设置.docx_第4页
第4页 / 共10页
Matlab坐设置.docx_第5页
第5页 / 共10页
亲,该文档总共10页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《Matlab坐设置.docx》由会员分享,可在线阅读,更多相关《Matlab坐设置.docx(10页珍藏版)》请在三一办公上搜索。

1、Matlab坐设置Matlab绘图和坐标操作 a=linspace(1,2,10) plot(a,pr,linewidth,1.5,MarkerEdgeColor r,MarkerFaceColor,m,MarkerSize,10) legend(a,Location,best) title(a,FontName,Times New Roman,FontWeight,Bold,FontSize,16) xlabel(T,FontName,Times New Roman,FontSize,14) ylabel(a,FontName,Times New Roman,FontSize,14,Rota

2、tion,0) axis auto equal set(gca,FontName,Times New Roman,FontSize,14) plot(X1,Y1,LineSpec, ?) 通过字符串LineSpec指定曲线的线型、颜色及数 1.曲线线型、颜色和标记点类型 据点的标记类型。 - 实线 r 红色 + 加号 -. 点划线 g 等方式对方发生法 o 圆圈 - 虚线 b 蓝色 * 星号 : 点线 c 蓝绿色 . 点 m 洋红色 x 交叉符号 y 黄色 square(s)方格 k 黑色diamond(d) 菱形 w 白色 上三角 v 下三角 > 左三角 < 右三角 pentagra

3、m(p) 五边形 hexagram(h) 六边形 2.设置曲线线宽、标记点大小,标记点边框颜色和标记点填充颜色等。 plot(,Property Name, Property Value, ) Property Name 意义 选项 LineWidth 线宽 数值,如0.5,1等,单位为points MarkerEdgeColor 标记点边框线条颜色 颜色字符,如g, b等 MarkerFaceColor 标记点内部区域填充颜色 颜色字符 MarkerSize 标记点大小 数值,单位为points 3.坐标轴设置 范围设置: a. axis(xmin xmax ymin ymax)设置坐标轴在

4、指定的区间 b. axis auto 将当前绘图区的坐标轴范围设置为MATLAB自动调整的区间 c. axis manual 冻结当前坐标轴范围,以后叠加绘图都在当前坐标轴范围内显示 d. axis tight 采用紧密模式设置当前坐标轴范围,即一用户数据范围为坐标轴范围 比例: a. axis equal 等比例坐标轴 b. axis square 以当前坐标轴范围为基础,将坐标轴区域调整为方格形 c. axis normal 自动调整纵横轴比例,使当前坐标轴范围内的图形显示达到最佳效果 范围选项和比例设置可以联合使用,默认的设置为axis auto normal 4.坐标轴刻度设置 set

5、(gca,XTick, 0 1 2) X坐标轴刻度数据点位置 set(gca,XTickLabel,a,b,c) X 坐标轴刻度处显示的字符 set(gca,FontName,Times New Roman,FontSize,14)设置坐标轴刻度字体名称,大小 FontWeight,bold 加粗 FontAngle,italic 斜体 对字体的设置也可以用在title, xlabel, ylabel等中 5.图例 legend(a,Location,best) 图例位置放在最佳位置 6.更多的设置可以在绘图窗口中打开绘图工具,Inspector? 中查找 b blue . point - s

6、olid 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 p pentagram k black d diamond h hexagram w white v triangle (down) > triangle (right) triangle (up) < triangle (left) b blue . point - solid g green o circle : dotted

7、 x x-mark -. dashdot (点画线) c cyan + plus(加号) - dashed(虚线) m magenta * star (none) no line y yellow s square > triangle (right) k black d diamond p pentagram v triangle (down) triangle (up) < triangle (left) h hexagram plot 函数可以接一些参数,来改变所画图像的属性。下面是一些属性的说明 b blue . point - solid g green o circle :

8、 dotted x x-mark -. dashdot (点画线) c cyan + plus(加号) - dashed(虚线) m magenta * star (none) no line y yellow s square p pentagram k black d diamond h hexagram v triangle (down) triangle (up) < triangle (left) > triangle (right) Example x = -pi:pi/10:pi; y = tan(sin(x) - sin(tan(x); plot(x,y,-rs,Lin

9、eWidth,2,. MarkerEdgeColor,k,. MarkerFaceColor,g,. MarkerSize,10) xlabel(x); ylabel(y); 用Matlab画图时,有时候需要对各种图标进行标注,例如,用“+”代表A的运动情况,“*”代表B的运动情况。 legend函数的基本用法是 legend(string1,string2,string3, .) 分别将字符串1、字符串2、字符串3?标注到图中,每个字符串对应的图标为画图时的图标。例如: plot(x,sin(x),.b,x,cos(x),+r) legend(sin,cos)这样可以把.标识为sin,把+标

10、识为cos 还可以用LEGEND(.,Location,LOC) 来指定图例标识框的位置 这些是Matlab help文件。后面一段是对应的翻译和说明 North inside plot box near top South inside bottom East inside right West inside left NorthEast inside top right (default) NorthWest inside top left SouthEast inside bottom right SouthWest inside bottom left NorthOutside out

11、side plot box near top SouthOutside outside bottom EastOutside outside right WestOutside outside left NorthEastOutside outside top right NorthWestOutside outside top left SouthEastOutside outside bottom right SouthWestOutside outside bottom left Best least conflict with data in plot BestOutside leas

12、t unused space outside plot North 图例标识放在图顶端 South 图例标识放在图底端 East 图例标识放在图右方 West 图例标识放在图左方 NorthEast 图例标识放在图右上方 NorthWest 图例标识放在图左上方 SouthEast 图例标识放在图右下角 SouthWest 图例标识放在图左下角 (以上几个都是将图例标识放在框图内) NorthOutside 图例标识放在图框外侧上方 SouthOutside 图例标识放在图框外侧下方 EastOutside 图例标识放在图框外侧右方 WestOutside 图例标识放在图框外侧左方 North

13、EastOutside 图例标识放在图框外侧右上方 NorthWestOutside 图例标识放在图框外侧左上方 SouthEastOutside 图例标识放在图框外侧右下方 SouthWestOutside 图例标识放在图框外侧左下方 Best 图标标识放在图框内不与图冲突的最佳位置 BestOutside 图标标识放在图框外使用最小空间的最佳位置 还是用上面的例子 legend(sin,cos,location,northwest)可以将标识框放置在图的左上角。 Examples: x = 0:.2:12; plot(x,bessel(1,x),x,bessel(2,x),x,bessel

14、(3,x); legend(First,Second,Third); legend(First,Second,Third,Location,NorthEastOutside) b = bar(rand(10,5),stacked); colormap(summer); hold on x = plot(1:10,5*rand(10,1),marker,square,markersize,12,. markeredgecolor,y,markerfacecolor,.6 0 .6,. linestyle,-,color,r,linewidth,2); hold off legend(b,x,Carrots,Peas,Peppers,Green Beans,. Cucumbers,Eggplant)

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号