I have the current function which generates a simple chart in matplotlib but as we see in the image the alpha parameter not seems to work, this happen in vs code, if I test this in a notebook works fine
what i need is the same format in vs code
data:
,hora,id
0,0,10
1,1,3
2,2,2
3,3,3
4,4,5
5,5,3
6,6,11
7,7,32
8,8,41
9,9,71
10,10,75
11,11,70
12,12,57
13,13,69
14,14,50
15,15,73
16,16,47
17,17,64
18,18,73
19,19,54
20,20,45
21,21,43
22,22,34
23,23,27
code:
import pandas as pd
from matplotlib import pyplot as plt
dfhoras=pd.read_clipboard(sep=',')
def questionsHour(dfhoras):
x = dfhoras['hora']
y = dfhoras['id']
horas=[x for x in range(24)]
plt.figure(facecolor="w")
plt.figure(figsize=(15,3))
plt.rcParams['axes.spines.top'] = False
plt.bar(x, y,linewidth=3,color="#172a3d")
plt.xticks(horas,fontweight='bold',color="#e33e31",fontsize=9)
plt.yticks(fontweight='bold',color="#e33e31",fontsize=9)
plt.grid(color="#172a3d", linestyle='--',linewidth=1,axis='y',alpha=0.15)
#aca creo las etiquetas de los puntos
for x,y in zip(x,y):
label = "{:.2f}".format(y)
plt.annotate(label,
(x,y),
textcoords="offset points",
xytext=(0,5),
ha='center',
fontsize=9,
fontweight='bold',
color="#e33e31")
plt.savefig('questions1.png',dpi=600,transparent=True,bbox_inches='tight')
questionsHour(dfhoras)


