1
我使用seaborn和matplotlib,使繪圖的jupyther筆記本電池做兩個地塊,一個是箱形圖:AttributeError的同時
ax = sns.boxplot(x=data["MEDV"])
另一種是在我改變規模的直方圖軸:
g = sns.distplot(data['MEDV'])
plt.ticklabel_format(style='sci', axis='both', scilimits=(0,0))
兩個圖作品,如果我讓他們在不同的細胞就好了,但如果我使用相同的小區:
ax = sns.boxplot(x=data["MEDV"])
g = sns.distplot(data['MEDV'])
plt.ticklabel_format(style='sci', axis='both', scilimits=(0,0))
我獲得以下錯誤:
AttributeError: This method only works with the ScalarFormatter.
這個問題沒有一個完整的例子,但我想象的問題是boxplot將文本刻度標籤放在圖上,不能以科學記數法呈現(因爲它們不是數字)。 – mwaskom