RadarURL

논문
2013.02.01 21:58

MATLAB Function Reference - legend

조회 수 7010 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

가 크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

가 크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

legend

Display a legend on graphs

Syntax

  • legend('string1','string2',...)
    legend(h,'string1','string2',...)
    legend(string_matrix)
    legend(h,string_matrix)
    legend(axes_handle,...)
    legend('off')
    legend('hide')
    legend('show')
    legend('boxoff')
    legend('boxon')
    legend(h,...)
    legend(...,pos)
    h = legend(...)
    [legend_h,object_h,plot_h,text_strings] = legend(...)
    

Description

legend places a legend on various types of graphs (line plots, bar graphs, pie charts, etc.). For each line plotted, the legend shows a sample of the line type, marker symbol, and color beside the text label you specify. When plotting filled areas (patch or surface objects), the legend contains a sample of the face color next to the text label.

legend('string1','string2',...) displays a legend in the current axes using the specified strings to label each set of data.

legend(h,'string1','string2',...) displays a legend on the plot containing the handles in the vector h, using the specified strings to label the corresponding graphics object (line, bar, etc.).

legend(string_matrix) adds a legend containing the rows of the matrix string_matrix as labels. This is the same as legend(string_matrix(1,:),string_matrix(2,:),...).

legend(h,string_matrix) associates each row of the matrix string_matrix with the corresponding graphics object in the vector h.

legend(axes_handle,...) displays the legend for the axes specified by axes_handle.

legend('off'),legend(axes_handle,'off') removes the legend in the current axes or the axes specified by axes_handle.

legend('hide'), legend(axes_handle,'hide') makes the legend in the current axes or the axes specified by axes_handle invisible.

legend('show'), legend(axes_handle,'show') makes the legend in the current axes or the axes specified by axes_handle visible.

legend('boxoff'), legend(axes_handle,'boxoff') removes the box from the legend in the current axes or the axes specified by axes_handle.

legend('boxon'), legend(axes_handle,'boxon') adds a box to the legend in the current axes or the axes specified by axes_handle.

legend_handle = legend returns the handle to the legend on the current axes or an empty vector if no legend exists.

legend with no arguments refreshes all the legends in the current figure.

legend(legend_handle) refreshes the specified legend.

legend(...,pos) uses pos to determine where to place the legend.

  • pos = -1 places the legend outside the axes boundary on the right side.
  • pos = 0 places the legend inside the axes boundary, obscuring as few points as possible.
  • pos = 1 places the legend in the upper-right corner of the axes (default).
  • pos = 2 places the legend in the upper-left corner of the axes.
  • pos = 3 places the legend in the lower-left corner of the axes.
  • pos = 4 places the legend in the lower-right corner of the axes.

[legend_h,object_h,plot_h,text_strings] = legend(...) returns:

  • legend_h - handle of the legend axes
  • object_h - handles of the line, patch and text graphics objects used in the legend
  • plot_h - handles of the lines and patches used in the plot
  • text_strings - cell array of the text strings used in the legend.

These handles enable you to modify the properties of the respective objects.

Remarks

legend associates strings with the objects in the axes in the same order that they are listed in the axes Children property. By default, the legend annotates the current axes.

MATLAB displays only one legend per axes. legend positions the legend based on a variety of factors, such as what objects the legend obscures.

legend installs a figure ResizeFcn, if there is not already a user-defined ResizeFcn assigned to the figure. This ResizeFcn attempts to keep the legend the same size.

Moving the Legend

You can move the legend by pressing the left mouse button while the cursor is over the legend and dragging the legend to a new location. Double clicking on a label allows you to edit the label.

Examples

Add a legend to a graph showing a sine and cosine function:

  • x = -pi:pi/20:pi;
    plot(x,cos(x),'-ro',x,sin(x),'-.b')
    h = legend('cos','sin',2); 

    graphiae.gif

In this example, the plot command specifies a solid, red line ('-r') for the cosine function and a dash-dot, blue line ('-.b') for the sine function.

See Also

LineSpec, plot

Adding a Legend to a Graph for more information on using legends

Annotating Plots for related functions

 

출처 : http://www.weizmann.ac.il/matlab/techdoc/ref/legend.html

?

공부 게시판

공부에 도움되는 글을 올려주세요.

  1. [공지] 공부 게시판 입니다.

    Date2003.08.18 By처누 Views2016566
    read more
  2. 카­톡 gusim8003 급전/내구제 (24시문의) 폰테크 소액대출 선불폰 가개통

    Date2026.10.05 Category논문 By타오르는켄타우로스86 Views1
    Read More
  3. 을지로가라오케 010 2817 0845 을지로 가라오케 예약 및 문의

    Date2026.10.04 Category취업 By속삭이는와이번53 Views6
    Read More
  4. 카_톡 gusim8003 선불유심내구제 (24시문의) 작업대출 선불유심 급한돈 가전내구제

    Date2026.10.03 Category취업 By광휘의퀘이사33 Views19
    Read More
  5. 강남안마❤️OlO-7593-9850❤️친절문의24시 #강남안마 #강남안마방 #강남클럽안마 #강남클럽식안마 #역삼동안마 #선릉안마 #삼성동안마 #대치동안마 #강남역안마 #논현동안마

    Date2026.10.03 Category업무 By괴랄한재규어89 Views11
    Read More
  6. 텔ㄹH:@holysim 선불유심내구제 신용불량자대출 신불 회생 파산 소액대출 비대면대출 폰내구제 폰깡 텔레그램:@holysim 가개통 선불유심내구제 정식내구제업체 선불폰삽니다 비상금대출

    Date2026.10.03 Category업무 By빠져드는환영18 Views17
    Read More
  7. EMR을 기반으로 DW를 구축한 병원의 CRM 활용 방안 연구 = The Study on a Plan to Activate Customer Relationship Management through Data Warehouse based on Electronic Medical Record of Hospitals

    Date2026.02.06 Category논문 ByYooN Views4107
    Read More
  8. 로그인 구글 드라이브 안 쓰고 시놀로지 드라이브 쓰는 이유, 설정 방법 & 활용팁

    Date2026.01.08 Category업무 ByYooN Views3854
    Read More
  9. 알아두면 좋은 직장인 용어 정리

    Date2025.04.15 Category업무 ByYooN Views3260
    Read More
  10. 국내에서 의사가 되는 로드맵

    Date2024.07.02 Category업무 ByYooN Views3050
    Read More
  11. 병원 의학 용어 정리 - 병원 과별 축약어 (ent, os, ps, gs, np, obgy, cv, NE, ID, er, ur, em, ge, pd, nicu..)

    Date2024.04.09 Category업무 ByYooN Views3160
    Read More
  12. 모달리티(Modality)

    Date2024.02.06 Category업무 ByYooN Views3426
    Read More
  13. [ 개발자 업무 파악 ] SI와 SM의 차이와 하루일과 출처: https://bnitech.tistory.com/19 [코딩몬의 하루:티스토리]

    Date2023.12.29 Category업무 ByYooN Views4519
    Read More
  14. 의과 대학에서 받는 학위의 종류와 과정에 대한 이야기

    Date2023.12.07 Category업무 ByYooN Views4225
    Read More
  15. ARO(Academic Research Organization), CRO(Contract Research Organization) 차이

    Date2023.06.23 Category업무 ByYooN Views3408
    Read More
  16. 계약직 직원 지칭하는 명칭 : 임기제(계약직), 개방형직위, 별정직, 전문직위제, 기간제 등

    Date2023.05.10 Category취업 ByYooN Views4539
    Read More
  17. (자격증) AWS아키 따는 법 -2023

    Date2023.04.10 Category업무 ByYooN Views3078
    Read More
  18. 기술사 학습 루틴

    Date2023.04.10 Category업무 ByYooN Views3113
    Read More
  19. 정보처리기술사 독학 vs 학원

    Date2023.04.10 Category업무 ByYooN Views3115
    Read More
  20. IT 기술사회 정보관리기술사 컴퓨터시스템응용기술사 공개설명회

    Date2023.04.10 Category업무 ByYooN Views3164
    Read More
  21. 정보관리냐? 컴퓨터시스템응용이냐? 선택의 기로에 있다면

    Date2023.04.10 Category업무 ByYooN Views3015
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12 Next
/ 12


즐겨찾기 (가족)

JAESOO's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너