Gnuplot to matplotlib time series

Hi, I’m struggling to reproduce some Gnuplot plots:

Into mathplotlib:

How do I plot against Last_Update being on the X axis? Any tips what to read, because [links retracted since I’m limited to two URLs]

Thanks !

Would normal plot work

plt.plot("Last_Update", "Confirmed", data=sg)
plt.plot("Last_Update", "Deaths", data=sg)
plt.plot("Last_Update", "Active", data=sg)

Then just set needed properties as described here https://matplotlib.org/3.3.1/api/_as_gen/matplotlib.pyplot.plot.html

Ps. You can also use sg["Last_Update"] instead of str + data= structure

Thank you, I’ve since updated https://github.com/kaihendry/covid19-sg/blob/master/pandas.ipynb

Is it possible to produce plots where if you mouse over you can use the value for that x/y mouse position?

Thank you!

that is called hovering. Yes, with some interactive backends have possibility to use the hover option.

See

See also info about the backends

https://matplotlib.org/3.1.0/tutorials/introductory/usage.html#backends

Maybe also mplcursors? https://mplcursors.readthedocs.io/en/stable/