table stackedplot with log y-axis

28 ビュー (過去 30 日間)
Tim Hattrell
Tim Hattrell 2019 年 9 月 30 日
編集済み: Adam Danz 2021 年 9 月 27 日
Is there a way to modify the axes properties of a plot of table data created using stackedplot. Specifically I'd like log y-axes. It appears that the relevant properties are not exposed so I'll have to do it the long way, unless anyone has any suggestions. I'd be happy to be proved wrong.

回答 (1 件)

Adam Danz
Adam Danz 2020 年 11 月 19 日
編集済み: Adam Danz 2021 年 9 月 27 日
Update: In Matlab R2021b or later, set the yscale property of stackedplot to log.
Prior ot R2021b, you can set the scale of the y-axis in stackedplot using the undocumented NodeChildren property. However, the vertical reference line and text that tracks the mouse position will no longer work and a warning will continually appear when the listener is invoked. Therefore, that warning should be turned off (see below).
h = stackedplot(1:50,[exp(1:50)',exp(1:.5:25.5)']);
ax = findobj(h.NodeChildren, 'Type','Axes');
set(ax,'YScale','log')
% Turn off warning that
warning('off','MATLAB:callback:error')
% Don't forget to turn it back on
% warning('on','MATLAB:callback:error')
To set the yscale of a specific axis, n
% set(ax(n),...

カテゴリ

Find more on Graphics Object Properties in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by