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
  • Please add a sniplet of the datafile.
    – jippie
    Apr 15, 2012 at 16:25
  • @jippie Edited my question
    – varesa
    Apr 15, 2012 at 16:28
  • Plots fine here. Can you try with the default term 'wxt' and see if the same issue happens? With wxt you can zoom in by dragging and clicking with your mouse.
    – jippie
    Apr 15, 2012 at 16:47
  • Try png instead of jpeg and see if it makes a difference.
    – jw013
    Apr 15, 2012 at 21:04
  • @varesa Did you try to increase the resolution?
    – Bernhard
    Apr 16, 2012 at 6:10

2 Answers 2


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, 2012 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.
    – user732
    Apr 16, 2012 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, 2012 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, 2012 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, 2012 at 11:51

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .