Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
share|improve this question
    
Please add a sniplet of the datafile. –  jippie Apr 15 '12 at 16:25
    
@jippie Edited my question –  varesa Apr 15 '12 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 '12 at 16:47
    
Try png instead of jpeg and see if it makes a difference. –  jw013 Apr 15 '12 at 21:04
    
@varesa Did you try to increase the resolution? –  Bernhard Apr 16 '12 at 6:10
show 2 more comments

2 Answers

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.

share|improve this answer
    
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. –  Bruce Ediger 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
show 1 more comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.