source: MML/trunk/machine/SOLEIL/common/toolbox/GUILayout/layoutHelp/User guide2_2.html @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 6.5 KB
Line 
1<html xmlns:saxon="http://icl.com/saxon">
2   <head>
3      <link rel="stylesheet" type="text/css" href="doc.css"/>
4      <link rel="stylesheet" type="text/css" href=""/>
5      <meta author="The MathWorks Ltd."/>
6      <meta copyright="2011 The MathWorks Ltd."/>
7      <title>Axes inside layouts</title>
8   </head>
9
10   
11    <body>
12      <table class="header" width="100%" border="0" cellspacing="0" cellpadding="0">
13         <tr>
14            <td bgcolor="#e4f0f8"><A href="User guide.html"><font face="Arial" bgcolor="#e4f0f8" size="+0" underline="0" color="#000000"><b>User guide</b></font></A></td>
15            <td width="36" bgcolor="#e4f0f8"><A HREF="User guide2_1.html"><IMG SRC="Images/leftarrow.png" BORDER="0" ALT="previous page"/></A><A HREF="User guide3.html"><IMG SRC="Images/rightarrow.png" BORDER="0" ALT="next page"/></A></td>
16         </tr>
17      </table>
18   
19
20      <br clear="all"/>
21         
22      <h2>2.2: Axes inside layouts&nbsp;<a href="User guide2.html"><img src="Images/uparrow.png" border="0" align="top" alt="Go back up one level"/></a></h2>
23     
24            <p>(The code for this example can be found here:
25                            [ <a href="Examples/axesexample.m">view</a>
26                | <a href="matlab: edit(fullfile(layoutRoot,'layoutHelp','Examples','axesexample.m'))">edit</a>
27                | <a href="matlab: p=pwd();cd(fullfile(layoutRoot,'layoutHelp','Examples')); axesexample; cd(p)">run</a> ]
28            )</p>
29            <p>
30                When using layouts to position axes, the position property
31                is set by the layout, not the user. Whether the "Position"
32                or "OuterPosition" property is used is determined by the
33                "ActivePositionProperty" property of the <a href="matlab:doc axes"><code class="FUNCTION">axes</code></a>.
34                Note that the default setting is "OuterPosition".
35            </p>
36            <p>
37                The following example illustrates the two usages.
38            </p>
39           
40            <h4>Open a window</h4>
41            <p>Open a new figure window and remove the toolbar and menus.</p>
42            <example><pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011">window = <a href="matlab:doc figure"><code class="FUNCTION">figure</code></a>( 'Name', 'Axes inside layouts', ...
43            'MenuBar', 'none', ...
44            'Toolbar', 'none', ...
45            'NumberTitle', 'off' );</font></pre>
46            <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/axes_layout_example_1.png"/></center></font></p>
47            </example>
48            <h4>Create the layout</h4>
49            <p>The layout involves two axes side by side. This is done using a flexible horizontal box. The left-hand axes is left with the ActivePositionProperty set to "OuterPosition", but the right-hand axes is switched to use "Position".</p>
50            <example><pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011">hbox = <a href="uiextras.HBoxFlex.html"><code class="FUNCTION">uiextras.HBoxFlex</code></a>('Parent', window, 'Spacing', 3);
51axes1 = <a href="matlab:doc axes"><code class="FUNCTION">axes</code></a>( 'Parent', hbox, ...
52    'ActivePositionProperty', 'OuterPosition' );
53axes2 = <a href="matlab:doc axes"><code class="FUNCTION">axes</code></a>( 'Parent', hbox, ...
54    'ActivePositionProperty', 'Position' );
55set( hbox, 'Sizes', [-2 -1] );</font></pre>
56             <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/axes_layout_example_2.png"/></center></font></p>
57           </example>
58           
59            <h4>Fill the axes</h4>
60            <p>Using "OuterPosition" (left-hand axes) is the normal mode and looks good for virtually any plot type. Using "Position" is only really useful for 2D plots with the axes turned off, such as images.</p>
61            <example><pre style="background-color: #eeeeff; margin-left: 20px; margin-right: 20px"><font color="#000011">x = membrane( 1, 15 );
62<a href="matlab:doc surf"><code class="FUNCTION">surf</code></a>( axes1, x );
63<a href="matlab:doc lighting"><code class="FUNCTION">lighting</code></a>( axes1, 'gouraud' );
64<a href="matlab:doc shading"><code class="FUNCTION">shading</code></a>( axes1, 'interp' );
65l = <a href="matlab:doc light"><code class="FUNCTION">light</code></a>( 'Parent', axes1 );
66<a href="matlab:doc camlight"><code class="FUNCTION">camlight</code></a>( l, 'head' );
67<a href="matlab:doc axis"><code class="FUNCTION">axis</code></a>( axes1, 'tight' );
68
69<a href="matlab:doc imagesc"><code class="FUNCTION">imagesc</code></a>( x, 'Parent', axes2 );
70set( axes2, 'xticklabel', [], 'yticklabel', [] );</font></pre>
71            <p style="background-color: #ddddee; margin-left: 20px; margin-right: 20px"><font color="#000022"><center><img src="Images/axes_layout_example_3.png"/></center></font></p>
72            </example>
73            <p/>
74       
75     
76      <br clear="ALL"/>
77      <table class="footer" width="100%" border="0" cellspacing="0" cellpadding="0">
78         <tr>
79            <td width="18" height="15" bgcolor="#e4f0f8" align="left"><a href="User guide2_1.html"><img src="images/leftarrow.png" border="0" alt="previous page"/></a></td>
80            <td width="40%" height="15" bgcolor="#e4f0f8" align="left"><a href="User guide2_1.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">Position vs OuterPosition</font></a></td>
81            <td width="20%" height="15" bgcolor="#e4f0f8" align="center"><a href="index.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">[Top]</font></a></td>
82            <td width="40%" height="15" bgcolor="#e4f0f8" align="right"><a href="User guide3.html"><font face="arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">Enable and Visible</font></a></td>
83            <td width="18" height="15" bgcolor="#e4f0f8" align="right"><a href="User guide3.html"><img src="images/rightarrow.png" border="0" alt="next page"/></a></td>
84         </tr>
85      </table>
86      <font face="Arial" bgcolor="#e4f0f8" size="normal" underline="0" color="#000000">&copy; 2011 The MathWorks Ltd</font>
87      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/license.txt'])">Terms of Use</a>
88      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/patents.txt'])">Patents</a>
89      <TT>&#149; </TT><a href="matlab: helpview([matlabroot,'/trademarks.txt'])">Trademarks</a>
90   
91   </body>
92</html>
93
94           
Note: See TracBrowser for help on using the repository browser.