Matlab画图及GUI总结

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轴,也可以只关联一个坐标轴。

posted @ 2011-12-26 16:20  秋天掰穗人  阅读(1488)  评论(0编辑  收藏  举报