简体   繁体   English

熊猫多个箱形图-如何减少地块之间的间距?

[英]Pandas multiple boxplots - how to reduce spacing between plots?

I have a plot with two boxplots: 我有两个箱形图的情节:

在此处输入图片说明

There is an awful lot of spacing between lan_data and wan_data. lan_data和wan_data之间有很多间距。 I would like to reduce that spacing. 我想缩小间距。

My dataframe is simply: 我的数据框很简单:

df = pd.DataFrame({'lan_data':random.sample(range(1, 100), 100), 'wan_data':random.sample(range(1, 100), 100)})

I have looked and all answers I come across pertain to either reducing the axis width, which just squashes the plot, or changing the position of the plots - none of those solutions appear to be appropriate. 我已经看过了,我遇到的所有答案都与减小轴宽度(只是挤压图)或更改图的位置有关-这些解决方案似乎都不适合。

Ideally, I'd like to be able to do something like: 理想情况下,我希望能够执行以下操作:

df.plot.box(box_padding = [top, bottom, left, right])

or 要么

df.plot.box(subplot_spacing = 1.5)

Any suggestions? 有什么建议么?

Try play with widths : 尝试玩widths

df.plot.box(widths=0.8)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM