Python Forum

Full Version: Show graphs in matplotlib from a sql query?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings,
I am in the absolute beginning of my programming journey trying to understand things and doing it the right way.
Now I somehow managed to fetch some data from a sqlite database like this -

result = c.execute('SELECT shortVolume, longVolume,DateTime FROM currencies WHERE name="XAUUSD" ORDER BY DateTime ASC')
all_rows = c.fetchall()
The query is stored in a list with nested tuples right? And the output of all_rows looks something like this -
Output:
[(2865.7, 4262.09, 1580910343.93018), (2864.88, 4261.76, 1580910643.59432), (2865.57, 4266.89, 1580910943.592479)]
Now from here I am little puzzled what I need to do next to prepare the plotting in matplotlib. Have read some tutorials but many of them use numpy, do I need it and will it help me out in this matter?

What I am looking for is one plot with two lines, one line for shortVolume and the other for longVolume but plotted on same chart.

I am stuck and need some guidance how to move on. Any kind help is appreciated.
Please delete this thread...