ggnuplot formatting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ggnuplot formatting
# 1  
Old 10-20-2011
ggnuplot formatting

hello,

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

Code:
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?

Last edited by radoulov; 10-20-2011 at 06:29 PM.. Reason: clarity; radoulov: code tags!
# 2  
Old 10-20-2011
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

Quote:
halp?
Please, no netspeak.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 10-20-2011
Code:
# 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.

Last edited by radoulov; 10-20-2011 at 06:30 PM.. Reason: Code tags!
# 4  
Old 10-20-2011
Oh, I see, you want tics/bars at the data points and nothing else.

You can title and place arbitrary tics like

Code:
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.
# 5  
Old 10-20-2011
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.
# 6  
Old 10-20-2011
Quote:
Originally Posted by kag3ythree
that makes me a little sad. thank you for the assistance though. even the link you used shows the date 00:00:00 anomaly.
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.
# 7  
Old 10-20-2011
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.

Last edited by kag3ythree; 10-20-2011 at 07:34 PM.. Reason: correction
This User Gave Thanks to kag3ythree For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with formatting

Hi, I am new to UNIX and need your help in formatting the below input command to the desire output Input: CREATE UNIQUE INDEX XPKTABLE1 ( COL1, COL2 ) ON TABLE_NM; Output: COMMENT ON TABLE DB_NM.TABLE_NM AS 'PK=,COL1,COL2; '; In... (14 Replies)
Discussion started by: varun2327
14 Replies

2. Shell Programming and Scripting

Formatting

Good day All, I have requirement where my input data looks like below ] Message5 Expecting Output as 04/MAR/2104 ||| 23:15:45 ||| servername ||| NOTIFICATION |||message1||||||userId|||||| Message5 I could not use space delimiter as in the messages I would be having them as... (2 Replies)
Discussion started by: Tomlight
2 Replies

3. Shell Programming and Scripting

Formatting Help

Hi Guys, i have report that runs every 10 min and send the report of failed jobs to my mail. Currently i am using a command like this to send mail. mailx -t -s "FAILURE JOBS IN HYDRA $temp_date" addressee@domain.com < temp_file5 But i am getting mail in this format ....... (4 Replies)
Discussion started by: gkrish
4 Replies

4. Shell Programming and Scripting

help formatting

I need to format a txt file and convert it in CSV. Any "future" column is separated by a newline. FROM: XS1 1.43294 0.0 XS2 1.21824 0.0 TO: XS1,XS2 (2 Replies)
Discussion started by: alfreale
2 Replies

5. Shell Programming and Scripting

formatting of df -k

Hello, I am developing a platform Independant tool that should work for all major unix flavors outlined in this forum(Solaris,Linux, AIX, HPUX, SCO,BSD) Therefore, in order to cover all types of user community, I have deliberately posted the same message on every forum. Please do not think... (9 Replies)
Discussion started by: darsh123
9 Replies

6. Shell Programming and Scripting

Formatting

Is there a way to make a 2 column output out of the following : 1 2 3 4 5 6 Output : 1 2 3 4 5 6 Thanks, Prasanna (3 Replies)
Discussion started by: prasanna1157
3 Replies

7. Shell Programming and Scripting

formatting

I have file with different columns for ex. contents of file "txt" NAME AGE MARKS HARRY 23 89 TOM 12 67 BOB 23 11 and you see its not formatted.Now, I need the file "txt" to be formatted like COLUMN1 COLUMN2 COLUMN3 NAME AGE ... (3 Replies)
Discussion started by: vijay_0209
3 Replies

8. Shell Programming and Scripting

Formatting

I have next part of script: for i in $LIST do echo "`date +"%H:%M:%S"` Converting $i ..."; mysql -uroot some -sABe "ALTER TABLE $i ENGINE=$ENGINE"; done I want to get following output formatting: "OK" must be one under another :) ... (3 Replies)
Discussion started by: mirusnet
3 Replies

9. UNIX for Dummies Questions & Answers

formatting

Hi Again Guys , Please i installed linux RH 6.1 on Toshiba , 10G , RAM=128 , 600 MHZ . After i installed linux i got many error messages , seems it was not installed correctly , also when i finished installation it did not ask me for the 2nd installation CD , and when i logged as root , i... (5 Replies)
Discussion started by: tamemi
5 Replies

10. UNIX for Dummies Questions & Answers

formatting

is it possible to format a powerbook g4 mac? like totally erase the HD then pop in the Mac OS cd and it will boot up an install like windows or any linux? (5 Replies)
Discussion started by: xeron
5 Replies
Login or Register to Ask a Question