MATLAB drawing Legend

Source: Internet
Author: User

Legend

(Resource:examples of legend in MATLAB document)

Usage:

1.legend (' string1 ', ' string2 ',...)

' String1 ', ' string2 ' in order to correspond to the curve in the graph;

HLEG1 = Legend (' cos_x ', ' sin_x ') will return a handle HLEG1

The underscore is recognized as subscript and can be avoided by using a handle to turn off the interpreter with set (HLEG1, ' interpreter ', ' none ');

The position of the legend is set by the handle, where there are northeast, northwest, SouthWest, southeast, such as: Set (HLEG1, ' location ', ' Northwest ');

The parameters are: Northeastoutside, Northwestoutside, Southeastoutside, Southwestoutside, with the handle setting the legend position and the original image.

or set specific positions by handle, such as set (HLEG1, ' Position ', [. 1,.2,.1,.2])

The font is set to italic by the handle, and the color is brown, for example: Set (HLEG1, ' fontangle ', ' Italic ', ' textcolor ', [. 3,.2,.1]), three coordinates represent red, green and blue respectively;


2.legend (H, ' string1 ', ' string2 ',...) Use a different handle to specify the order in which to appear in the legend, such as:

HB = Bar (y1, ' stacked ');

HP = Plot (1:10,y2); Hold off

Legend ([hb,hp], ' carrots ', ' peas ', ' peppers ', ' Green Beans ', ' cucumbers ', ' eggplant ', ' location ', ' southeastoutside ')








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.