欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    科学计算科学计算 (45).pdf

    • 资源ID:67732404       资源大小:923.08KB        全文页数:19页
    • 资源格式: PDF        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    科学计算科学计算 (45).pdf

    ChapterChapter 8 8 MATLABMATLAB GraphicalGraphical UserUserInterfaceInterface DesignDesign8.1 Figure and Axes8.2 Line and Surface8.3 Ways to Develop Apps8.4 App Development Using GUIDE8.5 App Development Using App Designer8.6 Examples of App DevelopmentHandleHandle ofof a a GraphicsGraphics ObjectObjectGraphicsGraphics ObjectObject PropertiesPropertiesF Figureigure ManipulationManipulationAxesAxes ManipulationManipulation8.1 Figure and Axes8.1 Figure and Axes1.Handle of a Graphics Object1.Handle of a Graphics Object(1)Whats a handle?A graph in MATLAB is composed of several specific graphics objects.A handle is used to identify an object,and to access the properties of the object.Example 1:Create several plots and save their handles.t=0:pi/10:2*pi;h1=plot3(t+pi,t-2*pi,sin(t),r);hold on;x,y=meshgrid(t);z=sin(x);h2=mesh(t-2*pi,t+pi,z);x3,y3,z3=cylinder(t);h3=surf(x3,y3,z3);1.Handle of a Graphics Object1.Handle of a Graphics Object(2)Access graphics objectsAccessing graphics objects refers to getting or setting the properties of graphics objects.Different graphics objects have different properties,but methods accessed are the same.Object.PropertyName x=0:pi/10:2*pi;y=sin(x);h0=plot(x,y);h0.Colorans=0 0.4470 0.7410 h0.LineWidth=2;h0.LineStyle=-.;1.Handle of a Graphics Object1.Handle of a Graphics Object(3)Get handles of specific graphics objectsgcf:get the handle of the current figure window.gca:get the handle of the current axes.gco:get the handle of the last object selected.findobj:locate graphics objects based on the value ofthe specific property.1.Handle of a Graphics Object1.Handle of a Graphics Object2.Graphics 2.Graphics Object PropertiesObject Properties(1)Common properties of graphics objectsChildren:An array composed of the handles of all child objects.Parent:Handle of the parent container.Type:Type of an object.It is read-only.Tag:Identifier of an object.subplot(1,2,1)h1=fplot(t)t.*sin(t),(t)t.*cos(t),0,6*pi);axis equalsubplot(1,2,2)x,y,z=peaks(20);h2=mesh(x,y,z);h10=h1.Parent;h10.Color=y;h1.Color=r;h2.Parent.Color=cyan;2.Graphics 2.Graphics Object PropertiesObject PropertiesExample 2:Create a line and a surface in two subplots respectively.Set the background colorof subplot 1 to yellow and the line color to red.Set the background color of subplot 2 to cyan.2.Graphics 2.Graphics Object PropertiesObject Properties(2)Dynamic properties of graphics objectsKeyPressFcn:in response to a keypress event.CreateFcn:responds when a graphics object is created.DeleteFcn:responds when a graphics object is deleted.WindowButtonDownFcn:in response to a click event.ButtonDownFcn:in response to a click event3 3.Figure Manipulation.Figure Manipulation(1)Create figure objectMATLAB creates figure objects through the figure function.Syntax:handle=figure(property1,value1,property2,value 2,)Properties are used to set the appearance of a figure window.handle=figureCreate the figure window using default property values.figure(handle)Make the figure corresponding to this handle the current window.3 3.Figure Manipulation.Figure Manipulation(2)Properties of figureMenuBar:Display or hide the default menus.The value is none or figureName:The name of a figure.NumberTitle:Whether the title of the figure includes the phrase Figure n.Color:Background color of a figure.3 3.Figure Manipulation.Figure Manipulation(2)Properties of figurePosition:Location and size of the drawable area.Its value is a row vector withfour elements,x,y,w,h.Units:Units of measurement,which affects the Size and Position property.pixels:Specify the measurement unit as pixels.(default)inches:Specify the measurement unit as inches.centimeters:Specify the measurement unit as centimeters.points:Specify the measurement unit as points.normalized:Specify units as the proportion to this area.hf=figure;hf.Color=0,1,1;hf.Position=1,1,300,150;hf.Name=Example of Figure;hf.NumberTitle=off;hf.MenuBar=none;hf.ButtonDownFcn=gtext(Hello,World!);Example 3:Create a figure window.The figure window has no menu bar and its title is Example of Figure.It locates at the left-bottom corner of the desktop,with a width of 300 pixelsand a height of 150 pixels.And the background is cyan.When the user press any key and clickin the figure,Hello,World will be displayed at the location of the mouse pointer.3 3.Figure Manipulation.Figure Manipulation4.Axes 4.Axes ManipulationManipulation(1)Create axes objectMATLAB creates axes objects through the axes function.Syntax:handle=axes(property1,value1,property2,value 2,)Properties are used to set the appearance of the axes.handle=axesCreate the axes using default property values.axes(handle)Set the current axes.4.Axes 4.Axes ManipulationManipulation(2)Properties of axesPosition:Location and size of the axes in the figure.Units:Units of measurement.Its default value is normalized.Box:Whether display the box outline around the axes.It can be specified as on or off(Default).GridLineStyle:Line style for grid lines.It can be specified as:(Default),-,-.,-,or none.Title:Axes title.Its value is the handle of the object created by the title function.4.Axes 4.Axes ManipulationManipulation(2)Properties of axesXlabel,Ylabel,Zlabel:Handles of axis label objects created by the xlabel,ylabel,and zlabelfunctions.XLim,YLim,Zlim:The lower limit and upper limit of x-,y-,z-axis.Their value is two-element vectors Lmin,Lmax.The default value is 0,1.XScale,YScale,Zscale:Scale of values along x-,y-,z-axis,specified as linear scale or logscale.The default value is linear.View:The azimuth and elevation of view,specified as a two-element vector az,el.The azspecifys the azimuth of view and the el specifys the elevation.The default value is 0 90.ha1=axes(Position,0.1,0.1,0.7,0.7);contour(peaks(20)ha1.Title=title(等高线等高线);ha1.YLabel=ylabel(南北向南北向);ha1.XLabel=xlabel(东西向东西向);ha2=axes(Position,0.65,0.7,0.28,0.28);surf(peaks(20)ha2.View=-30,45;Example 4:Split the figure window using axes objects.4.Axes 4.Axes ManipulationManipulation(2)Properties of axesColorOrder-The palette of colors MATLAB uses to create plot objects.It is a three-columnmatrix of RGB triplets.Each RGB triples represents one color.The default array has 7 rows.hc=gca;C=hc.ColorOrderC=0 0.4470 0.74100.8500 0.3250 0.09800.9290 0.6940 0.12500.4940 0.1840 0.55600.4660 0.6740 0.18800.3010 0.7450 0.93300.6350 0.0780 0.18404.Axes 4.Axes ManipulationManipulationx=0,0;y=0,1;ha=axes;ha.ColorOrder=0,0,0;1,0,0;0,1,0;0,0,1;hold onplot(x,y,x+0.5,y,x+1,y,x+1.5,y,x+2,y,x+2.5,y);ha.XLim=-0.2,3;ha.YLim=-0.2,1.2;4.Axes 4.Axes ManipulationManipulationExample 5:Set the ColorOrder property for the figure containing 4 colors.Then plot 6 curves.

    注意事项

    本文(科学计算科学计算 (45).pdf)为本站会员(奉***)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开