Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
638 views
in Technique[技术] by (71.8m points)

gnuplot drawing multiple plots in same chart

I'm trying to follow the guide to plotting financial data on gnuplot found here:

http://gnuplot.sourceforge.net/demo/finance.html

I generated some data and tried plotting with the following script:

  1 set datafile separator ","
  2 set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb"#cccccc" behind
  3 
  4 set xdata time
  5 set timefmt "%Y-%M-%dT%H:%M:%S"
  6 set format x "%d-%H"
  7 
  8 set ylabel "Price"
  9 set xlabel 'Time'
 10 
 11 set style line 100 lt 1 lc rgb "grey" lw 0.5
 12 set style line 101 lt 1 lc rgb "orange" lw 1
 13 
 14 set grid ls 100
 15 set key off
 16 
 17 plot "lastrun.dat" using 1:2 with lines, '' using 1:3 with lines ls 101, '' using 1:4 with lines ls 101

however the resulting graph seems to not stich together the data correctly, so instead of one chart, i have three in the same space.

enter image description here

i'm sure i'm making a simple error but I've been stumped about what that is.

question from:https://stackoverflow.com/questions/66067024/gnuplot-drawing-multiple-plots-in-same-chart

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Check help time_specifiers:

%d day of the month, 01–31 
%H hour, 00–23 (always two digits) 
%m month, 01–12 
%M minute, 0–60 
%S second, integer 0–60 on output, (double) on input 
%Y year, 4-digit

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...