How to set wiskers and box in the boxplot?
Afficher commentaires plus anciens
Hello, I would like to set none line the outline border of the box , but it becomes black. If I remove the outline border, the wiskers also remove. So I try to change color of the outline border, but wiskers also change color. I would like leave the wiskers lines in black and the border with out the line, just with the fill color. Any help?
Here is my code.
grp = cell2mat(arrayfun(@(i){i*ones(numel(cuad_periodo{i}),1)},(1:numel(cuad_periodo))'));
boxplot(vertcat(cuad_periodo{:}),grp); set(gca,'fontsize',16);hold on
h = findobj(gca,'Tag','Box');
Box=get(get(gca,'children'),'children');set(Box,'Color',[0.4660, 0.6740, 0.1880]);
lines = findobj(gcf, 'type', 'line', 'Tag', 'Median');set(lines, 'Color', 'k','linewidth',2);
for i=1:96
patch(get(h(i),'XData'),get(h(i),'YData'),'y','FaceAlpha',.9,'FaceColor',[0.4660, 0.6740, 0.1880],'LineStyle','none');
end
set(gca,'children',flipud(get(gca,'children')))
h=findobj(gca,'tag','Outliers');delete(h)
3 commentaires
Fabian Moreno
le 8 Juil 2021
Manan Jain
le 9 Juil 2021
Hi, Please share your solution, so others with similiar queries can get help. Thank you !
Fabian Moreno
le 11 Juil 2021
Réponses (0)
Catégories
En savoir plus sur Box Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!