0
A
回答
2
我认为这个问题与unit
有关。该函数预期在数据传递为DataFrame
的情况下指示数据属于哪个主题。这个函数行为对我来说并不明显,但看到这个例子。
# Test Data
df = pd.DataFrame({'month': [1, 2, 3, 4, 5, 6],
'value': [11.5, 9.7, 12, 8, 4, 12.3]})
# Added a custom unit with a value = 1
sns.tsplot(data=df, value='value', unit=[1]*len(df), time='month')
plt.show()
您还可以使用提取Series
和绘制。
sns.tsplot(data=df.set_index('month')['value'])
plt.show()
0
我有同样的问题。在我的情况下,这是由于数据不完整,因此每个时间点至少有一个缺失值,导致默认估计器每个时间点返回NaN。
既然你只显示你的数据的前5条记录,我们不能分辨你的数据是否有同样的问题。您可以看到以下修补程序是否正常工作:
from scipy import stats
sns.tsplot(data = df_month, time = 'month',
value = 'pm_local',
estimator = stats.nanmean);
相关问题
- 1. 带seaborn tsplot的多线图
- 2. seaborn:如何制作tsplot正方形
- 3. 熊猫的seaborn tsplot问题
- 4. Seaborn tsplot显示什么
- 5. 如何翻转seaborn tsplot图上的坐标轴?
- 6. Matplotlib y轴的比例不拟合值
- 7. D3 Y轴比例不可见
- 8. 带有比例Y轴的Google Chart
- 9. 两个相同比例的y轴
- 10. seaborn tsplot:传奇色彩变淡
- 11. 展开Y比例,但Y轴线的极限高度
- 12. 如何在MS Chart中设置X轴和Y轴的比例?
- 13. list_plot中x轴和y轴的缩放比例相同
- 14. 在Excel图表上使X轴和Y轴比例相等
- 15. y在散点图中比例缩放y轴与y值不同y D3.js
- 16. 使用不同时间序列的Seaborn tsplot绘图
- 17. 如何设置seaborn boxplot的y轴范围?
- 18. 错误的y轴范围使用matplotlib subplots和seaborn
- 19. Seaborn distplot y轴正常化错标签标签
- 20. 如何在y轴上绘制比例密度图?
- 21. 谷歌图表Y轴不与图表比例
- 22. 如何获得x和y轴的缩放比例数据
- 23. ggplot上y轴的比例对于geom_line是成组的
- 24. jqplot条形图上的Y轴缩放比例
- 25. 直方图(计数):y轴的变化比例
- 26. Flot:如何让x和y轴保持相同的比例?
- 27. 如何将y轴更改为对数比例?
- 28. R:在boxplot中更改y轴缩放比例
- 29. ggplot:来自堆叠比例条形图的y轴(中断)值?
- 30. MPAndroidChart,Y轴比例得到更新,但行不是
您可以编辑代码为[完整示例](https://stackoverflow.com/help/mcve)吗? –