Fix window width in bar plot

1 回表示 (過去 30 日間)
Inti Vanmechelen
Inti Vanmechelen 2021 年 11 月 23 日
コメント済み: Inti Vanmechelen 2021 年 11 月 23 日
Hi,
I am making bar plots of reponses of a survey and I have added 2 examples in attachment.
For plot 1, the response options - and also ytick labels are: 'Yes' - 'Depends on the sitation of the individual' - 'No' - 'DID NOT REPLY'
For plot 2, the response options - and also ytick labels are: 'I agree to some extent' - 'I disagree' - 'I agree to some extent' - 'I agree' - 'DID NOT REPLY'
I would like to plot those different plots under one another but because the yticklabels of plot 2 are longer (in text), matlab automatically squeezes the window in which the bars are given. Are there settings to fix the window in which the bars are given with respect to the yticklabels? I have not managed to find them yet.
Thanks for you help :)

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 11 月 23 日
Consider https://www.mathworks.com/help/matlab/ref/ytickangle.html if you are using R2016b or later.
(If you are using R2015b or R2016a there are also methods, just not a nice interface for them.)
  1 件のコメント
Inti Vanmechelen
Inti Vanmechelen 2021 年 11 月 23 日
Hi Walter,
Thanks for the quick reply.
Just wondering if I'm missing something here? Changing the angle of the yticklabels does not solve my problem of different bar-window sizes in the 2 plots (since the text of plot 1 is still longer then the text of plot 2)
(But please note that I massively appreciate your help)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by