MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

xlim([61.31 69.31])
ylim([116.7 183.3])


If MATLAB is unable to determine where to place the generated code, the Update Code
button is disabled. This occurs, for example, if you modify the code without running the
script again. In this case, use the Copy button to copy the generated code into the
clipboard. You then can paste the code into your script at the appropriate location.


Add Formatting and Annotations


In addition to exploring the data, you can format and annotate your figures interactively
by adding titles, labels, legends, grid lines, arrows, and lines. To add an item, first select
the desired figure. Then, go to the Figure tab and, in the Annotations section, select one
of the available options. Use the down arrow on the right side of the section to display all
available annotations. To add a formatting or annotation option to your favorites, click the
star at the top right of the desired annotation button. To undo or redo a formatting or


annotation action, click or at the upper right corner of the toolstrip.


Annotation options include:



  • Title — Add a title to the axes. To modify an existing title, click the existing title
    and enter the modified text.


  • X-Label, Y-Label — Add a label to the axes. To modify an existing label,
    click the existing label and enter the modified text.




  • Legend — Add a legend to the figure. To modify the existing legend
    descriptions, click the existing descriptions and enter the modified text. Select
    Remove Legend from the Annotations section to remove the legend from the axes.




  • Colorbar — Add a color bar legend to the figure. Select Remove Colorbar
    from the Annotations section to remove the color bar legend from the axes.




  • Grid, X-Grid, Y-Grid — Add grid lines to the figure. Select
    Remove Grid from the Annotations section to remove all the grid lines from the
    axes.




Modify Figures in Live Scripts
Free download pdf