Usually when I plot some distribution I like to insert auxiliar lines to show extra information, such as mean:
plt.figure(figsize=(15, 5))
h = r1['TAXA_ATUAL_UP'].mean()
plt.axvline(h, color='k', linestyle='dashed', linewidth=2)
print(h) # 692.6621026418171
plt.annotate('{0:.2f}'.format(h), xy=(h+100, 0.02), fontsize=12)
sns.distplot(r1['TAXA_ATUAL_UP'].dropna())
sns.distplot(r1[r1['REMOTO'] == 1]['TAXA_ATUAL_UP'].dropna(), hist=False, label='Y = 1')
sns.distplot(r1[r1['REMOTO'] == 0]['TAXA_ATUAL_UP'].dropna(), hist=False, label='Y = 0')
Recently, using the same code to plot other data, I got a weird result. Basically, what I notice is that the h
value is big and the result is that the plot is reduced drastically:
plt.figure(figsize=(15, 5))
h = r1['TAXA_ATUAL_DOWN'].mean()
plt.axvline(h, color='k', linestyle='dashed', linewidth=2)
print(h) # 8777.987291627895
plt.annotate('{0:.2f}'.format(h), xy=(h, 0.02), fontsize=12)
sns.distplot(r1['TAXA_ATUAL_DOWN'].dropna())
sns.distplot(r1[r1['REMOTO'] == 1]['TAXA_ATUAL_DOWN'].dropna(), hist=False, label='Y = 1')
I wonder what causes this I how I should get the annotation to work properly, or fix whaterver I'm doing wrong.