简体   繁体   中英

Changing Range in Y axis of Boxplot in Python

How can I change the y-axis values to show the full number of digits?

import seaborn as sns
sns.boxplot (x="waterfront", y="price", data=df)

I wanted the full range of digits to show (as in screenshot "target"), but the boxplot I created shows an annotated one (as in screenshot "current").

Target:

目标规模

Current:

当前规模

See answer from here: Seaborn / Matplotlib: How to repress scientific notation in factorplot y-axis

This is the code you need:

import seaborn as sns
import matplotlib.pyplot as plt

sns.boxplot (x="waterfront", y="price", data=df)
plt.ticklabel_format(style='plain', axis='y',useOffset=False)

示例图片

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