2

I have following commands:

set xdata time
set timefmt "%s"
set terminal jpeg size 800,600
set output "image.jpg"
set yrange [-100:]
plot "file" using 1:2

Which provide the following output:

Result without "lines"

But if I add with lines to the end of the plot-command, I get this:
Result with "lines"

There are some big "boxes" on the right side of the image. What am I doing wrong?

Snippet from the datafile:

1334425549 435 255
1334425555 515 255
1334425560 597 255
1334425566 475 255
1334425571 431 255
1334425577 560 255
1334425582 411 255
1334425588 469 255
1334425593 484 255
1334425599 584 255
varesa
  • 2,336
  • 5
  • 20
  • 19

2 Answers2

3

My thought is that you've got a lot of data points that are out-of-order with respect to the X-axis, which is apparently some kind of date. Or maybe you've got some incorrectly formatted lines in the part of the data file that shows up as weird blocks.

Try sorting the input file with column 1 as key (something like sort -n +0 -1 whatever > whaterver.sorted, and then plot the sorted file. Or write a little sed or awk script to verify the format of all the lines in the file, including whatever sorting should appear.

  • The x-values are time-values recorded, lets say everey 15 secs. Unless something is really wrong with my servers clock, they should be in order. Worth trying though. I never thought about the order, because they _show_ in the right order on the screen – varesa Apr 16 '12 at 20:08
  • gnuplot will put data for (arbtrarily) March 30th on the left of April 15th, but when you say "with lines" it will draw a line from right to left, if March 30's data appears *after* April 15th's data. I've done this with gnuplot many times. –  Apr 16 '12 at 20:57
  • I agree, there must be something fishy with the data. Is uploading the datafile somewhere feasible or is it confidential in some way? – jippie Apr 16 '12 at 21:12
  • @BruceEdiger Thats what I meant by me not thinking about it at first because the points "show" in the right order. My comment was not too clear about that though – varesa Apr 17 '12 at 11:48
  • @jippie I don't think I would have a problem with uploading it. How/ Where should I upload it to? – varesa Apr 17 '12 at 11:51
  • @varsea you can upload your data for example to http://pastebin.com/ or http://paste.debian.net/ – jofel Apr 17 '12 at 12:41
0

As strange as it is, the problem just disappeared. I did not touch the data-files or anything. .. The boxes just don't appear anymore

varesa
  • 2,336
  • 5
  • 20
  • 19