在python中绘制轮廓Hitstograms [英] Plotting profile hitstograms in python
问题描述
我正在尝试为pandas.DataFrame的两列绘制轮廓图.我不希望这直接在熊猫中出现,但在matplotlib中似乎也没有.我到处搜索,找不到除rootpy以外的任何程序包.在花时间自己写这篇文章之前,我想我想问一下是否有一个包含轮廓直方图的小程序包,也许在另外一个地方用另外的名字知道.
I am trying to make a profile plot for two columns of a pandas.DataFrame. I would not expect this to be in pandas directly but it seems there is nothing in matplotlib either. I have searched around and cannot find it in any package other than rootpy. Before I take the time to write this myself I thought I would ask if there was a small package that contained profile histograms, perhaps where they are known by a different name.
如果您不了解配置文件直方图"的含义,请查看ROOT实现. http://root.cern.ch/root/html/TProfile.html
If you don't know what I mean by "profile histogram" have a look at the ROOT implementation. http://root.cern.ch/root/html/TProfile.html
推荐答案
Use seaborn. Data as from @MaxNoe
import numpy as np
import seaborn as sns
# just some random numbers to get started
x = np.random.uniform(-2, 2, 10000)
y = np.random.normal(x**2, np.abs(x) + 1)
sns.regplot(x=x, y=y, x_bins=10, fit_reg=None)
您可以做更多的事情(误差带来自引导程序,您可以更改y轴上的估算器,添加回归,...)
You can do much more (error bands are from bootstrap, you can change the estimator on the y-axis, add regression, ...)
这篇关于在python中绘制轮廓Hitstograms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!