-1
I’m a beginner in python
I’m trying to plot a graph by calling the function:
def plota_grafico(sistema, resultado, r, variavel)
As I have few variables I have created blocks of if depending on the choice of the variable. They all work correctly except the following block:
if variavel == 'CMO':
for i, iusi in enumerate(resultado["DGer"]):
plt.plot(x+1, iusi['CMO'], marker='d')
plt.title('Evolução do Custo Marginal de Operação ($)')
plt.xlabel('Período ou Mês de Planejamento')
plt.ylabel('Custo Marginal de Operação ($)')
plt.xticks(x+1)
plt.grid()
plt.tight_layout()
The error marks the third line. If necessary, I share the rest of the code. However it is extended, it has other functions besides the plotting.
It seems that you are trying to assemble a Dashboard, I advise you to share the dataset and the code you are using. You posted the error but did not post on which line it might be occurring, so it is complicated to help.
– lmonferrari
Really, there is little information rs. I’m new here too. I’ve managed to solve it. But thank you so much for the willingness to help!
– Larissa Gargiulo