Remove gray lines from Boxplot Extrememode

2 views (last 30 days)
Kirsten
Kirsten on 26 May 2017
Answered: J Philps on 31 May 2017
I'm trying to remove the gray lines from the boxplot when using ('extrememode', 'compress') settings. I would rather it look more like just an axis break. Anyone know how to do this? Thanks! (I'm using Matlab 2013a)

Answers (1)

J Philps
J Philps on 31 May 2017
You can access the individual lines in the axes if you wish (and you can set their Color property to [0 0 0]).
Here is an example of how to remove the lines from a simple boxplot using this method:
load carsmall
figure;
boxplot(MPG, 'ExtremeMode', 'compress');
xlabel('All Vehicles')
ylabel('Miles per Gallon (MPG)')
title('Miles per Gallon for All Vehicles')
fig = figure;
boxplot(MPG, 'ExtremeMode', 'compress');
xlabel('All Vehicles')
ylabel('Miles per Gallon (MPG)')
title('Miles per Gallon for All Vehicles')
lines = fig.Children.Children.Children
lines(4).Color = [1 1 1];
lines(5).Color = [1 1 1];
lines(6).Color = [1 1 1];
lines(7).Color = [1 1 1];

Tags

Community Treasure Hunt

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

Start Hunting!