Is there a user-accessible mechanism for controlling intra-group density in grouped bar plots?

조회 수: 1 (최근 30일)
Motivation: I'm finding inter-group spacing is smaller than I'd prefer for some applications, particularly when the number of bars per group is large.
Aiming to improve visual separation of the groups by increasing intra-group density.
So far ...
  • I had initially guessed that setting the 'BarWidth' parameter during call to bar might have automatically triggered a reduction in offsets around the nominal x-values. This doesn't appear to be the case.
  • I seem to be able to get/set 'XOffset' but to no effect.
  • Direct control of bar polygons?: 'XEndPoints' appears to be read-only.
Cheers
  댓글 수: 2
Monisha Nalluru
Monisha Nalluru 2020년 11월 17일
Hi Amos,
I am not able to reproduce the issue. Can you share the code?
Amos
Amos 2020년 11월 18일
Thanks Monisha.
The main problem may have been my question.
The edited version is more generally motivated and is easily illustrated, I hope.
Please find attached an .mlx file.
Cheers

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

채택된 답변

Monisha Nalluru
Monisha Nalluru 2020년 11월 19일
Hi Amos,
Right now how bar plot works is, each bar is asigned a specific width and each group is assigned a specific width. So changing the width of bar in group increases or decreases the intra-grouping space. There is no option for increasing the inter-group spacing.
But as an workaround to increase the inter-group space, add a column with 0 value at end of matrix so it creates extra space for bar which is empty.
As an example
m=rand(5,5)-0.5;
a=size(m);
m=[m zeros(a(1,1),1)];
bar(m,1)

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by