Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-22-2012, 09:14 AM   #1
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Rep: Reputation: 8
Gnuplot not displaying data correctly

Hi all,

I'm experiencing a little problem with Gnuplot:
I want to make a plot of a data file which contains of 2 colums: the first one is the date
and the second one is the CPU usage in %.
As you can see, multiple CPU times exists for one day.

But, gnuplot only plots the "13/6 64" and the "13/6 62" lines, not the others...

What did I wrong?

set terminal png truecolor
set output "test.png"
set autoscale
set style data lines
set xdata time
set timefmt "%d/%m"
plot "stats_cpu.txt" using 1:2 with boxes
13/6    63
13/6    70
13/6    60
13/6    64
14/6    62
14/6    63
14/6    57
Here is the output:
Old 06-22-2012, 12:07 PM   #2
Registered: Oct 2011
Location: New Zealand
Distribution: Debian
Posts: 105

Rep: Reputation: 37
Could it be that gnuplot is plotting just two values, one each for when the date (%d/%m) is 13/6 and 14/6? Such that most of your data-points are being plotted against just the same two dates. But if each piece of data can be plotted against its own unique date/time, then the resulting gnuplot output will be much improved.

So you have only plotted your data against day and month. But perhaps if you plotted against hour, day and month (set timefmt "%H/%d/%m"), then each time-point would be unique, and your plot output fixed thusly?

Last edited by dru8274; 06-22-2012 at 12:29 PM.
2 members found this post helpful.
Old 06-24-2012, 05:59 AM   #3
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Original Poster
Rep: Reputation: 8
Thanks for your help, that worked!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Program for school not displaying correctly l0v1n Linux - Newbie 2 08-20-2009 04:17 PM
8.10 - Keys not displaying correctly anthonysaulnier Ubuntu 3 11-16-2008 03:49 AM
VNC not displaying correctly BallsOfSteel Linux - Software 1 04-22-2008 06:29 PM
gnuplot, pull X data from file, specify Y data at cmd line? hedpe Programming 5 03-16-2007 12:32 AM
windows not displaying correctly zchoyt Linux - General 1 03-19-2005 11:37 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration