Page 98 - A Guide to MATLAB for Beginners and Experienced Users
P. 98

Customizing and Manipulating Graphics         79


                                                               2
                                                                  2
                                                                          2 2
                                                                       2
                                             The lemniscate x -y =(x +y )
                                   1
                                  0.8

                                  0.6

                                  0.4
                                  0.2

                                y  0                         ← a node, also an inflection
                                                                 point for each branch
                                 -0.2

                                 -0.4

                                 -0.6
                                 -0.8

                                  -1
                                     -1  -0.8  -0.6  -0.4  -0.2  0  0.2  0.4  0.6  0.8  1
                                                            x
                                 Figure 5-9

                       ’FontSize’, 16, ’FontName’, ’Helvetica’,...
                       ’FontWeight’, ’bold’)
                       >> text(0, 0, ’\leftarrow a node, also an inflection’)
                       >> text(0.2, -0.1, ’point for each branch’)
                       >> xlabel(’x’); ylabel(’y’)
                     The result is shown in Figure 5-9. Note that many symbols (an arrow pointing
                     to the left in this case) can be inserted into a text string by calling them
                     withnames starting with \. (If you’ve used the scientific typesetting program
                     T X, you’ll recognize the convention here.) In most cases the names are self-
                      E
                     explanatory. For example, you get a Greek π by typing \pi, a summation sign
                       by typing either \Sigma (for a capital sigma) or \sum, and arrows pointing

                     in various directions with \leftarrow, \uparrow, and so on. For more details
                     and a complete list of available symbols, see the listing for “Text Properties”
                     in the Help Browser.
                       An alternative is to make use of the tool bar at the top of the figure window.
                     The button indicated by the letter “A” adds text to a figure, and the menu item
   93   94   95   96   97   98   99   100   101   102   103