绘制大熊猫DATAPLOT和mathlib数据图海誓山盟

问题描述:

plt.figure() 
mu = 0 
variance = 1 
sigma = math.sqrt(variance) 
x = np.linspace(0, 2, 100) 
plt.plot(x,mlab.normpdf(x, mu, sigma)) 
plt.show() 
movieRates.plot.hist(stacked=True) 

覆盖这就是我想出来,但它不工作,它给了我一个图1和图2。我试图找到一个答案,但我真的不能因为它们与我的不同,所以可以从其他例子中得到任何东西。我试图达到的目的是表明电影评价有一个正常的分布。这就是为什么我想一起加入这些数字。但我现在还没有运气。绘制大熊猫DATAPLOT和mathlib数据图海誓山盟

+0

你想覆盖**图。有*许多*解决这个问题的答案。 http://*.com/questions/31104867/how-to-superimpose-figures-in-matplotlib –

+1

[如何在matplotlib中叠加数字]可能的重复(http://*.com/questions/31104867/how-在matplotlib) –

+0

@ShawnMehan是我一直在看着他们,但不知道什么无花果或斧头意味着这就是为什么我不知道如何做到这一点在我的情况 – TenebrisNocte

让我们使用plt.gca(),然后使用熊猫图的ax参数。

plt.figure() 
mu = 0 
variance = 1 
sigma = math.sqrt(variance) 
x = np.linspace(0, 2, 100) 
plt.plot(x,mlab.normpdf(x, mu, sigma)) 
ax = plt.gca() 
movieRates.plot.hist(stacked=True,ax=ax) 
plt.show() 
+0

非常感谢:D我只是不知道把斧头放在熊猫的哪里 – TenebrisNocte