How to make the location of legend do not interfere the axes?

조회 수: 1 (최근 30일)
Khanh
Khanh 2014년 12월 28일
댓글: Image Analyst 2014년 12월 28일
Hi,
Could someone know how to make the location of legend with 'NorthEastOutSide' do not interfere the axes? I mean when I use this option the width of the axes will be changed. So I can't use multiple x axes. Is it possible to make the NorthEastOutSide option doesn't affect the width of the axes?
The below pictures show the axes before and after using the legend.
Before
After
Thank you.

채택된 답변

Image Analyst
Image Analyst 2014년 12월 28일
There is an input argument of legend() that lets you specify where you want the legend to appear.
  댓글 수: 2
Khanh
Khanh 2014년 12월 28일
Thank you. I found out that I can use 'position' property to set the location and size of lengend instead of using 'location' property and my question's solved.
Image Analyst
Image Analyst 2014년 12월 28일
Your next task is to fix the colors in the legend so that they're not all blue. You might want to plot the things separately with a unique color for each one. Or if they're all in a 2D array, try transposing it before you call plot().

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by