How to Increase the rectangular block marker in legend in bar plot

조회 수: 4 (최근 30일)
Jitin Malhotra
Jitin Malhotra 2021년 6월 24일
댓글: Jitin Malhotra 2021년 6월 24일
I am plotting a bar plot with 5 bars, and each bar has different color (thanks to @imageanalyst), I also got the legend for it, but how to increase the size of the rectangular block marker showing the color of each bar, as when i put it in word at 100% screen size, its not even visible

답변 (1개)

millercommamatt
millercommamatt 2021년 6월 24일
Better design practice is to label the bars directly rather than keeping the label information off the the side in a legend box away from the data. Edward Tufte preaches about this sort of thing constantly.
As for your specific request, it seems that if you alter the Legend.Position property, the size of the box markers in the legend scales with the height of the legend box. So, if you increase the height, the vertical size of the box markers will change. The horizontal size doesn't seem to change. In my experimenting, the legend box moved when I did this so you'll need to manually set the x and y values so that your legend box is where you want it in the figure window.
  댓글 수: 2
Jitin Malhotra
Jitin Malhotra 2021년 6월 24일
Thanks Matthew for your quick reponse, but for me it doesn't work, i tried it, the size of that block is not scaling up by changing any of the x and y values.
Jitin Malhotra
Jitin Malhotra 2021년 6월 24일
@Image Analyst, can you please help on the above question?

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

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by