I have the following data readout of a smart gasmeter, the file contains data of a full month.
date;time;natural gas consumption cumulative
2023-03-01;00:00;5434.291
2023-03-01;00:01;5434.292
2023-03-01;00:02;5434.293
2023-03-01;00:03;5434.294
2023-03-01;00:04;5434.295
...
...
2023-03-02;00:00;5435.123
2023-03-02;00:01;5435.124
2023-03-02;00:02;5435.125
2023-03-02;00:03;5435.126
2023-03-02;00:04;5435.127
I would like to plot a graph of the gas consumption per hour as a bar chart for the full month. Would like to have a separate bar per hour with the value of gas used in that hour. How to do this in Gnuplot?
gnuplot << eor
set xtics rotate # displays labels on x-axis vertical
set y2tics # y-ax values also on the right
set grid ytics mytics mxtics xtics # draw lines for each ytics and mytics
set mytics 2 # set the spacing for the mytics
#set mxtics 2
set grid # enable the grid
set xdata time
set timefmt '%Y-%m-%d;%H:%M'
set datafile separator ';'
set terminal pngcairo size 1400,600 enhanced font 'Helvetica,12'
set output '/dev/shm/images/p1_data_gas.png'
# create line chart
set style data line
set style line 2 lt 1 lw 1 pt 1 linecolor rgb "orange-red"set title "Gas consumption"
set xlabel "Time \n measurement interval (1 minute)"
set ylabel "Gas consumtion (m³)"
plot '/home/pi/p1_data.csv' using 1:3 title "Gas cumulative"
eor
This creates a line chart with data of a full month in an increasing line (as expected).