Is it possible to change stackedplots background color?
Show older comments
I have been developing apps with stackedplots, but I can't find a way to change the background color (white by default).
I guess is not implemented for this type of plots, so I was wondering if there is any other trick I can use.
Accepted Answer
More Answers (1)
You can get the axis handles in stackedplot using the undocumented NodeChildren property. Then change background color.
rng('default')
h = stackedplot(rand(100,4));
ax = findobj(h.NodeChildren, 'Type','Axes');
set(ax,'Color',[.8 .8 .8])
To set the color of a selected axis number n,
% set(ax(n), ...)
1 Comment
Gonçalo Torres
on 19 Nov 2020
Thanks a lot, extremely helpful!
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!