Graph is generated but does not show data, matplotlib

Asked

Viewed 33 times

0

inserir a descrição da imagem aquiI’m a beginner in Python, I’m not finding the reason for the graph to be generated blank. How can I declare this for plt?Gráfico em branco

  • Buddy, without the code we can’t help you

  • Really there was, posted the code, thank you! now this complete.

  • The variables country, start_dt and end_dt are strings. What was the expected result for the attempt to "plot 3 strings"?

  • 1

    Welcome to [en.so]! You have posted an image of the code and/or error message. Although it sounds like a good idea, it’s not! One of the reasons is that if someone wants to answer the question, they can’t copy the code and change something inside. Click on the [Edit] link and put the code/error as text. See more about this in these links - Manual on how NOT to ask questions, Post Error Message as Picture

1 answer

2


In accordance with documentation of Matplotlib, the representation of a graph based on date and value, is possible through the use of two Arrays, example:

datas = ['01/02', '02/02', '03/02']
mortes = [2, 10, 35]

plt.plot(datas, mortes)
plt.xlabel('Data')
plt.ylabel('Mortes')
plt.show()

This way, just take the values obtained from JSON, assign them in the Array and present them.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.