RadarURL

논문
2013.02.01 21:58

MATLAB Function Reference - legend

조회 수 4232 추천 수 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

?

공부 게시판

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

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 [공지] 공부 게시판 입니다. 처누 2003.08.18 927853
1266 응용 프로그래밍 C/C++ 프로그램 수행 시간 측정 JaeSoo 2013.01.20 4552
1265 네트워크 Nslookup을 사용하여 MX 레코드 구성 확인 방법 JaeSoo 2013.01.22 3941
1264 모바일 국내 1호 태블릿 아이덴티티탭 추천하고 싶지 않은 이유 file JaeSoo 2013.01.22 5767
1263 건강 방광암에 대해서 JaeSoo 2013.01.25 3707
1262 건강 전국 방광암 전문의 JaeSoo 2013.01.25 5011
1261 건강 방광암 전문분야 의사정보 JaeSoo 2013.01.25 3622
1260 건강 방광암 JaeSoo 2013.01.25 3982
1259 건강 방광암에 대해서.. JaeSoo 2013.01.25 4098
1258 보안 정보유출방지 (DLP, Data Loss Prevention) file JaeSoo 2013.01.25 2963
1257 논문 복잡도(complexity)의 개념 JaeSoo 2013.01.26 4154
1256 경제 내집마련기 부동산 책 추천 리스트 file JaeSoo 2013.01.26 3885
1255 논문 C 로 구현한 알고리즘 - 1부 준비, 4장 알고리즘 분석 file JaeSoo 2013.01.26 4711
1254 웹 프로그래밍 세이프 브라우징 (jaesoo.com에 대한 진단 페이지) JaeSoo 2013.01.26 2930
1253 네트워크 IPTIME N6004M 으로 LG IPTV 공유기 대체 file JaeSoo 2013.01.31 5039
1252 네트워크 IPTV 끊김 증상 문의 JaeSoo 2013.01.31 4731
1251 네트워크 LG IPTV 기본 공유기를 IPTIME 유무선공유기로 바꾸기 or 통합하기 file JaeSoo 2013.01.31 6402
1250 논문 MATLAB - legend (Graph legend for lines and patches) JaeSoo 2013.02.01 15508
» 논문 MATLAB Function Reference - legend file JaeSoo 2013.02.01 4232
1248 건강 섹스가 건강에 좋은 이유 (부드러운 섹스는 200㎉, 격렬히 하면 600㎉) JaeSoo 2013.02.03 3524
1247 건강 [전립선 비대증] 갑자기 소변 줄기 약해진 회사원, 병원갔더니.. file JaeSoo 2013.02.04 3796
Board Pagination Prev 1 ... 56 57 58 59 60 61 62 63 64 65 ... 124 Next
/ 124


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

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

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

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

JServer.kr

제이서버 메타블로그

재수 티스토리


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

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너