python - seaborn barplot 的 pyplot 等价物是什么?
问题描述
我想转换这个条形图:
sns.barplot(x='Pclass', y='Survived', data=train_df)
使用 Pandas 数据框或 pyplot 的内置绘图功能如何将这个 seaborn 条形图转换为 pyplot 条形图?
解决方案
With pure pyplot
(import matplotlib.pyplot as plt
):
plt.bar(x='Pclass', height='Survived', data=train_df)
推荐阅读
- spring-data-mongodb - Excluding bad data models during query
- r - How to request Xero API in R programming language?
- javascript - 返回第 n 个
- php - ErrorException 为 foreach() 提供的参数无效
- mysql - 如何对具有与另一个名称表相关的两列外键的表执行 mysql 选择查询
- perl - Perl脚本配对两个数组
- javascript - How to preserve last page when using back button with react-router?
- json - How to GET data of a key in json using curl?
- mysql - MySQL 的 Docker 实例未设置 root 密码——允许任何没有密码的登录
- android - Android 模拟器中的按钮看起来很难看