Pareto chart and XTickLabelRotation

1 回表示 (過去 30 日間)
Grzegorz Knor
Grzegorz Knor 2017 年 4 月 3 日
コメント済み: Grzegorz Knor 2017 年 4 月 3 日
Is there a way to plot Pareto chart and rotate XTick labels properly? Let's look at the code:
y = randi(1e3,10,1);
names = {'long name 1';
'name 2';
'name 3';
'name 4';
'long name 5';
'name 6';
'name 7';
'name 8';
'name 9';
'long name 10'};
[H, ax] = pareto(y,names);
[ax.XTickLabelRotation] = deal(30);
On my computer results is as follows:
Positions of axes aren't the same. I can add 'correction' to my code:
ax(2).Position = ax(1).Position;
Indeed, it works:
But, for example after maximizing the window positions of axes are not the same once again.
Do you know how to solve this issue?

採用された回答

dpb
dpb 2017 年 4 月 3 日
Looks like an implementation bug. You can make the following fixup
...
[H, ax] = pareto(y,names);
linkprop(ax,'position') % keep the two axes positions in cahoots w/ each other...
[ax.XTickLabelRotation] = deal(30); % now this works and should stay in synch going forward.
You could make the fixup in the file or create a copy to alias it if don't want to mung on original.
Worthy of a bug report to www.mathworks.com support.
  1 件のコメント
Grzegorz Knor
Grzegorz Knor 2017 年 4 月 3 日
Thank you, I forgot about linkprop function. Moreover, bug request has been successfully submitted.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics and Visualization についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by