ggnuplot formatting

hello,

I'm building a chart using gnuplot. it outputs a file just fine, but the data I'm plotting looks like:

10/16/11-18:14:23 5:5:4 0
10/16/11-22:48:43 5:5:4 0
10/17/11-03:23:01 5:5:4 1
10/17/11-07:57:20 5:5:4 63
10/17/11-12:31:42 5:5:4 1
10/17/11-17:06:02 5:5:4 1
10/17/11-21:40:21 5:5:4 1
10/18/11-02:14:40 5:5:4 455
10/18/11-06:49:01 5:5:4 0
10/18/11-11:23:19 5:5:4 1
10/18/11-15:57:39 5:5:4 0
10/18/11-20:31:58 5:5:4 1
10/19/11-01:06:17 5:5:4 66
10/19/11-05:40:38 5:5:4 0
10/19/11-10:14:59 5:5:4 0
10/19/11-14:49:18 5:5:4 2

I get the chart it's all good. I get on the x axis, things like: 10/19/11 00:00:00

I would like it to show the timestamp, the fields after the "-" in the first column.

I'm only plotting the first and last columns,
halp?

You set the time format gnuplot uses with set timefmt. I think the string you want is set timefmt "%m/%d/%y-%H:%M:%S

Please, no netspeak.

1 Like
# gnuplot script file for plotting bandwidth over time
#!/usr/local/bin/gnuplot
reset
set terminal png nocrop enhanced size 768,768 font "/usr/share/fonts/liberation/LiberationMono-Regular.ttf" 10
#set terminal png nocrop enhanced size 768,600 xffffff


set xdata time
set timefmt "%m/%d/%Y-%H:%M:%S"
set format x "%m/%d/%y\n %H:%M:%S"

#set term pdfcairo font "sans,12"
#set term pdfcairo font "Times,12"
#set term pdfcairo font "Times-New-Roman,12"

set xtics auto
set xtics rotate by -45
set ytics auto
set xlabel "Date (mm/dd/yy)"
set ylabel "title"
set style data lines
set title "value for 5:5:4 over time"
set key below
set grid
set size 1.0,1.0


plot "statport_combo.out" using 1:15

the script I use is above. that is the timefmt value I use.

Oh, I see, you want tics/bars at the data points and nothing else.

You can title and place arbitrary tics like

set xtics   ("A" 0.00000, "B" 1.00000, "C" 2.00000, "D" 3.00000)

There doesn't appear to be a way to take tic positions directly from the data.

that makes me a little sad. thank you for the assistance though. even the link you used shows the date 00:00:00 anomaly. I wonder if this is worthy of bringing up to hte dev group.

perhaps I'm missing why this shouldn't work.

---------- Post updated at 02:56 PM ---------- Previous update was at 02:42 PM ----------

it appears that this can work:

http : / / www gnuplot info / demo / timedat html

sorry for the obscuration.

What anomaly? It's doing exactly what it's supposed to do -- mark time at regular intervals, like graph paper.

[edit] ---- Previous update was at 04:19 PM ----------[/SIZE][/COLOR]

Oh, is smaller intervals all you want?

gnuplot doesn't think it has room for anything but marks on the hour. So it marks on the hour.

You can force them smaller with set xtics 1800, 30 minutes * 60 seconds per minutes is 1800 seconds.

it's not what I want it to do though.

I would like to demonstrate how the data points are, at east date/time combination. I appreciate that it's doing as it's told, I just want to tel it something else.

The example I posted (sans "." and extra " ") shows that it'll show somehow the granularity I expect. I also see that it would be simpler if I just just say, map each data point (column 15) to each date/time (column 1), draw. I know it's a lot of data and printing, but this is exactly what I want / expect.

even if its' only showing half hour intervals, and it's 30 inches wide, it's better than showing me the poor resolution in the time sequence.

I just saw your edit, let me attempt that.

1 Like

Right, sorry. Somehow I got the idea you were trying to label individual data points. :wall:

1 Like

alright I'm getting some data that I can use thanks!

Now can I get this to be wider? it seems like it's cutting off the right edge,

Here's the script I'm using now. same data as before just about 98 samples of it.

# gnuplot script file for plotting bandwidth over time
#!/usr/local/bin/gnuplot
reset
set terminal png nocrop enhanced font "/usr/share/fonts/liberation/LiberationMono-Regular.ttf" 10
#set terminal png nocrop enhanced size 768,600 xffffff

set xdata time
set grid
set key box outside below
set xtics 75000

set timefmt "%m/%d/%y-%H:%M:%S"

set xtics rotate by -45
set ytics auto
set xlabel "Date (mm/dd/yy)"
set ylabel "datapoint"
set style data lines
set title "data for 5:5:4 over time"
set key below
set grid
set size 2.5,1.0


plot "statport_combo.out" using 1:15

I don't have the same font files or configuration as you so I really can't see what you're seeing. I don't even get text rotation.

1 Like

that's probably the older version, 4.0 p0. I just upgraded to 4.4 p3. that supports the rotate. but the font stuff get's a little harsh. I just searched for ttfs and selected one that was present.

I'm not talking about the font you picked, just that you used one at all.

I might need the same fonts to see the same problem anyway, if it's actually clipping like you think.

I've recompiled a gnuplot with TTF support and installed the same fonts you have. Your script bombs out with

plot "statport_combo.out" using 1:15
                                  ^
"./whatever.gnuplot", line 24: warning: Skipping data file with no valid points

plot "statport_combo.out" using 1:15
                                    ^
"./whatever.gnuplot", line 24: x range is invalid

...which makes sense because it has 3 columns, not 15...

Fixing that, I get a graph with only two labels because you've selected a tick size of 20 hours.

What exactly were you wanting again?

---------- Post updated at 05:51 PM ---------- Previous update was at 05:48 PM ----------

I've got it. If you don't stretch it with set size 2.5,1.0 then it prints all the labels. Set the resolution you want with set terminal png size x,y ... instead.

1 Like

great thanks!