简体   繁体   中英

How to dock bars to the bottom of the bounding box with Matplotlib in Python?

I'm drawing a Barplot in Python with matplotlib, and currently it looks as follows.

在此处输入图像描述

Briefly, I'm measuring a quantity called EOD under different settings (represented with different colors), and plotting the mean and std. dev. values for each setting over multiple measurements I've done.

The problem is, this EOD quantity can strictly take non-negative values so the area under 0 is misleading. I know this happens because for some settings (for example the blue one) the std. dev is larger than mean value. Still, I'd like to prevent this.

In short, how can I dock my bars to the bottom of the bounding box where it should start from 0?

ax.set_ylim(ymin=0)

did the trick as suggested by JohanC in the comments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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