Gnuplot question

Issues related to applications and software problems
Post Reply
fiberkill
Posts: 19
Joined: 2016/09/15 12:46:47

Gnuplot question

Post by fiberkill » 2022/05/18 06:59:00

Hi,
sorry for asking this question, but i'm new in Gnuplot and little confused.

I have a data file (plot_size_transferd.csv) in csv format and a plot file like:

###############################
set title 'Size transfered'
set xlabel 'Date'
set ylabel 'Transfered size (GB)'
set grid x2tics ytics
set datafile separator ";"
set xtics rotate by 90 right out nomirror

set term jpeg enhanced giant size 1024,768
set output 'size_transfered.jpg'

plot "plot_size_transferd.csv" title "CDGSHG" with line lt -1 lw 1 linecolor rgb "blue"
###############################

if i run my gnuplot file i get a graph like you can see in file 'wrong_graph.PNG', but i expect a graph like in 'file expected_graph.PNG', which i created in excel withou any modifications.

can you please explain me, whats wrong whith my plot file ??

Thanks in advance.
FK
Attachments
plot_size_transferd.csv
this is my data file
(1.47 KiB) Downloaded 42 times
this is what i get from Gnuplot
this is what i get from Gnuplot
wrong_graph.PNG (68.44 KiB) Viewed 1396 times
this is what i expect
this is what i expect
expected_graph.PNG (87.39 KiB) Viewed 1396 times

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Gnuplot question

Post by jlehtone » 2022/05/20 12:39:42

The question "How to use Gnuplot?" is not specific to CentOS.
Out of curiosity I did browse gnuplot's own website and got these:

Code: Select all

set ylabel 'Size transfered'
set xlabel 'Date'
set title 'Transfered size (GB)'
set grid x2tics ytics
set datafile separator ";"
set xtics rotate by 90 right out nomirror

set key autotitle columnhead
unset key

set timefmt "%Y.%m.%d-%H:%M:%S"
set xdata time
set format x "%Y.%m.%d"
set term jpeg enhanced giant size 1024,768
set output 'size_transfered.jpg'

plot "plot_size_transferd.csv" using 1:2 title "CDGSHG" with line lt -1 lw 1 linecolor rgb "blue"
Gnuplot was not happy about the header line (columnhead), so found a way to ignore.
The 'timefmt' tells how to read time from file.
The 'xdata time' tells that x-values are time.
The 'plot' had to have 'using 1:2' explicitly.

Post Reply