我正在尝试修改自动图文集的颜色,即autoct。我得到以下错误:“AxesSubplot”对象不可编辑。 你能帮我一下吗?在
_, _, autotexts = df_spark["Record_count_check"].value_counts() \
.sort_index(ascending=False) \
.plot(kind='pie', y="Record_count_check", figsize=(10, 10),
legend=True, autopct='%1.1f%%', startangle=90,
shadow=False,colors=['green','red'])
.plot
返回一个轴,因此不能将其分配给多个值。在要获取文本,请使用matplotlib
^{pr2}$或者在轴上迭代文本
相关问题 更多 >
编程相关推荐