matplotlib - 为什么 seaborn 样式在 matplotlib 中不起作用?
问题描述
直到最近在设置我的 matplotlib 绘图的样式时,我都会使用 seaborn-darkgrid。下面的代码工作了很长时间,但现在它只显示默认样式。我认为我的代码有问题,但现在我在线查看 Matplotlib 样式表参考页面,它的 seaborn 样式图也显示为默认样式。
matplotlib.pyplot.style 不再支持 seaborn 样式吗?
链接:https ://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
plt.style.use('seaborn-darkgrid')
dfLOADA = df_dayM[['InfNH3', 'EffNH3']]
plt.plot(dfLOADA)
plt.title('Influent and Effluent NH3: ' + month)
plt.xticks(dfLOADA.index[::7])
plt.legend(dfLOADA.columns)
plt.xlabel('Time [days]')
plt.ylabel('[mg NH3/L]')
plt.show()
解决方案
推荐阅读
- android - Google 表格 - 在移动设备上过滤视图
- vue.js - 如何为我的 vuetify 应用程序制作响应式导航栏设计
- r - 间隔、持续时间和周期的不同时间长度
- laravel-backpack - 在 Laravel Backpack 中公开 CRUD 操作的 API 端点
- c# - 为什么 EF Core 2.1 只为 2 个 FK 添加 1 个索引?
- reactjs - 从函数参数中调用的 setState 无法导致渲染
- reactjs - React - 具有不同入口点/部分的应用程序的最佳实践
- azure - 如何将 Hive 分区和分桶文件中的文件合并为一个大文件?
- php - 自定义令牌响应
- php - PHP Telegram bot:如何按顺序发送消息