博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Matlab画图及GUI总结
阅读量:6701 次
发布时间:2019-06-25

本文共 4948 字,大约阅读时间需要 16 分钟。

Certain graphics objects can contain other objects. Consider a graph, for example. In a graph, an object like a line represents data . Normally, the parent of the line is an axes (i.e., the handle of the line's Parent property is set to the handle of the axes that contains it). A figure is normally the parent of an axes. A typical object diagram of a graph looks like the next figure.

 

 

 

 

When graphs become more complicated and represent data with multiple objects, you can group these objects together so you can perform operations on the group as a whole.

handle.figure=figure('PropertyName','PropertyValue',...)

  Part of PropertyName and its value:

    'color'    : 'y','b','r','k','g','w','c','m', [R, G, B]

    'menubar'  : none | {figure}

    'name'    : string

    'numbertitle'  : {on} | off

    'position'    : [left, bottom, width, height]

 

handle.uicontrol=uicontrol(parent,'PropertyName','PropertyValue', ...)

  Part of PropertyName and its value:

    'backgroundcolor' : 'y','b','r','k','g','w','c','m', [R, G, B]

    'callback' : 

    'fontname' : string

    'fontsize' : integer

    'foregroundcolor' : color of text

    'horizontalalignment' : left | {center} | right; horizontal alignment of label string

    'position' : [left, bottom, width, height]

    'string' : Uicontrol object label, also list box and pop-up menu items

    'style' : {pushbutton} | togglebutton | radiobutton | checkbox | edit | text | slider | frame|

        listbox | popupmenu

 

handle.axes=axes('PropertyName','PropertyValue', ...)

  Part of PropertyName and its value:

    'box' : on | {off}; specifies whether to enclose the axes extent in a box for 2-D views or a cube

        for 3-D views.

    'Children': Vector of handles of all graphics objects rendered within the axes (whether visible or not). The graphics

      objects that can be children of axes are image, light, line, patch, rectangle, surface, and text. Change the

      order of the handles to change the stacking of the objects on the display.

    'color' : {none} | 'y','b','r','k','g','w','c','m', [R, G, B]; Color of the axes back planes.

    'fontangle' : {normal} | italic | oblique; specification to tick mark labels

    'fontname' : font family name | 'fixedwidth'

    'fontsize' : {12} | integer; specification to tick mark labels

    'fontunits' : {points} | normalized | inches | centimeters | pixels

    'fontweight' : {noemal} | bold | light | demi

    'gridlinestyle' : - | -- | {:} | -.

    'linewidth' : {0.5} | number; width of axes lines in points

    'minorgridlinestyle' : - | -- | {:} | -.

    'parent' : figure or uipanel handle

    'position' : [left, bottom, width, height]

    'tickdir' : in | out

    'ticklength' : [2DLength, 3DLength]

    'title' : handle of text object

        axes title. The handle of the text used for the axes title. Use this handle to change the

        properties of the title text or you can set Title to the handle of an existing text object.

        For example, the following statemen changes the color of the current title to red:

            set(get(gca,'Title'),'Color','r')

        To create a new title, set this property to the handle of the text object you want to use:

            set(gca, 'title', text('string','New Title', 'color', 'r'))

        However, it is simpler to use the title command to create or replace an axes title:

            title('New Title','Color','r') % Make text color red             

            title({'This title','has 2 lines'}) % Two line title

    'units' : inches | centimeters | {normalized} | points | pixels | characters

    'xaxeslocation' : top | {bottom}

    'yaxeslocation' : {left} | right

    'xcolor, ycolor, zcolor' : specification of the color of the axis lines, tick marks, tick matk labels, and

            the respective x-, y-, and z-axis. The default axis color is black.

    'xdir, ydir, zdir' : {normal} | reverse; direction of increasing values

    'xgrid, ygrid, zgrid' : on | {off}

    'xlabel, ylabel, zlabel' : handle of text object

    'xlim, ylim, zlim' : [minimum, maximum]

    'xminorgrid, yminorgrid, zminorgrid' : on | {off}

    'xminortick, yminortick, zminortick' : on | {off}

    'xscale, yscale, zscale' : {liner} | log

    'xtick, ytick, ztick' : vector of data values locating tick marks

    'xticklabel, yticklabel, zticklabel' : 

        cell array of string : set(gca,'XTickLabel',{'1';'10';'100'});

        padded string matrices : set(gca,'XTickLabel',['1 ';'10 ';'100']);

        string vectors separated by vertical slash characters : set(gca,'XTickLabel','1|10|100');

        numeric vectors : set(gca,'XTickLabel',[1;10;100]).

          Note that tick labels do not interpret TeX character sequences (however, the Title, XLabel,

         YLabel, and ZLabel properties do)

 

同步缩放坐标轴linkaxes

linkaxes命令,可以将一个figure中的各个axes指定相同的坐标范围,实现各个绘图同步放大、缩小。在缩放一个绘图时,其它也会同步缩放。可以同时关联x、y轴,也可以只关联一个坐标轴。

转载于:https://www.cnblogs.com/mphyfin/archive/2011/12/26/2302232.html

你可能感兴趣的文章
CentOS常用到的查看系统命令
查看>>
kafka学习总结
查看>>
第七章 数组
查看>>
***PHP 去除换行符
查看>>
Ubuntu Sudo 无法解析的主机
查看>>
Python 3.5.2 TypeError: a bytes-like object is required, not 'str’问题解决方案
查看>>
Android中SimpleAdapter的使用—自定义列表
查看>>
Java常见Jar包的用途
查看>>
P1616 疯狂的采药(洛谷,动态规划递推,完全背包)
查看>>
MySQL同步状态双Yes的假象及seconds_behind_master的含义
查看>>
DAL调用SP时出现的异常处理
查看>>
javascript学习(11)——[设计模式]工厂模式
查看>>
BZOJ 1087 [SCOI2005]互不侵犯King ——状压DP
查看>>
【转】Linux 下修改Tomcat使用的JVM内存大小
查看>>
xcode 开发ios兼容性问题的上下黑边 和 coco2d-x 游戏分辨率适配 ResolutionPolicy::FIXED_WIDTH 都会引起上下黑边问题!!!...
查看>>
剑指offer(一):二维数组中的查找
查看>>
编程之美-第3章 结构之法
查看>>
WinForm部署问题
查看>>
[解题报告]591 - Box of Bricks
查看>>
XP系统中没有Internet信息服务windows组件解决办法
查看>>