python-3.x - 如何从饼图中剪切标签并用python将其放入图例中
问题描述
我想剪下馅饼的标签并将它们放入图例中。
dict={'a':45, 'b': 123, 'c':2, 'd':1755, 'e':13}
ser = pd.Series(dict)
print(ser)
ser.plot(kind='pie', shadow=True, autopct='%1.2f%%', pctdistance=1.2)
plt.show()
解决方案
推荐阅读
- r - 如何生成 if 语句以输出相应的行
- ruby-on-rails - 使用 Devise 从 Turbolinks 升级到 Turbo 后,我得到“未定义的方法 `to_model' for true:TrueClass”
- datetime - 如何从飞镖中的周数和年份获取日期时间
- typescript - 未处理的承诺拒绝:错误:网络错误 + 需要周期
- android - 无法解析配置“:app:devDebugRuntimeClasspath”的所有依赖项。对存储库使用不安全的协议,没有
- python - TensorFlow方法中的Jupyter笔记本进度条问题
- sqlite - 加密整个数据库是否比只加密数据更安全?
- javascript - 如何获取地图中特定键的值?
- java - 为什么我们需要在 ViewHolder 构造函数中调用 super(view)?
- laravel - 在不以 JSON 格式保存数据的情况下以可重复方式加载数据的问题 Laravel-Backpack