在 Python 中更改箱线图 Y 轴的范围
Changing Range in Y axis of Boxplot in Python
如何更改 y 轴值以显示完整的数字位数?
import seaborn as sns
sns.boxplot (x="waterfront", y="price", data=df)
我想要显示完整的数字范围(如“目标”屏幕截图中所示),但我创建的箱线图显示了一个带注释的数字(如“当前”屏幕截图中所示)。
目标:
当前:
从这里查看答案:
这是您需要的代码:
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)
如何更改 y 轴值以显示完整的数字位数?
import seaborn as sns
sns.boxplot (x="waterfront", y="price", data=df)
我想要显示完整的数字范围(如“目标”屏幕截图中所示),但我创建的箱线图显示了一个带注释的数字(如“当前”屏幕截图中所示)。
目标:
当前:
从这里查看答案:
这是您需要的代码:
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)