Sponsored Content
Top Forums Shell Programming and Scripting Gnuplot spitting junk to CL, saying file not found Post 302877630 by 06s23 on Monday 2nd of December 2013 04:40:52 PM
Old 12-02-2013
Wrench Gnuplot spitting junk to CL, saying file not found

Hi,
I am making a shell script in bash which uses gnuplot to plot the number of road accidents on a certain day, on a certain month. I believe I have the data correct. An example of my data file is here:

Code:
cat Day1Accidents.txt
01 13
02 5
03 17
04 8
05 16
06 18
07 12
08 7
09 23
10 12
11 7
12 19

(So the left column [x axis] is the month, and the second [y] is the number of accidents, and the whole data set is for "monday")
But I cant seem to get gnuplot to make me an image, I tried putting in a <gpi> script, I got a simple graph(not what i wanted though) but then it didnt seem to want to plot, and there are problems with importing file name etc
Currently the code spits loads of unusual character to the command line, and then says the file is not found....
Here is my gnuplot code, if anyone can point me in the right direction I would be very grateful Smilie

Code:
gnuplot << EOF
set output "accidents_"$Postocode.png"
set terminal png
set size 1280,800
set data style linespoints
set title "Number of accidents within a radius of $2 from $Postcode"
set xlabel "Month"
set ylabel "Number of Accidents"
set xtics 1,1,12
set ytics 5,5,35
set key rmargin
plot "Day1Accidents.txt" using 1:2 title "Monday"
plot "Day2Accidents.txt" using 1:2 title "Tuesday"
plot "Day3Accidents.txt" using 1:2 title "Wednesday"
plot "Day4Accidents.txt" using 1:2 title "Thursday"
plot "Day5Accidents.txt" using 1:2 title "Friday"
plot "Day6Accidents.txt" using 1:2 title "Saturday"
plot "Day7Accidents.txt" using 1:2 title "Sunday"
EOF

Thanks

Last edited by bartus11; 12-02-2013 at 05:47 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Get rid of junk character in a file

I have a file with one of the following lines, when opened with vi 33560010686GPT£120600GBPGBP10082007DS In the above line, I want to get rid of the junk character before the £ (pound sysmbol). When I tried copying £ from windows and copy in unix vi, it prints as £ and I tried pattern replace... (2 Replies)
Discussion started by: nskworld
2 Replies

2. Shell Programming and Scripting

Junk Character in file

Hi set filename "./GopiRun.sh" if } err] { writeLog "error in exec " writeLog $a } else { writeLog $a } The above code will execute a file GopiRun.sh,and will log the output of the exec to a file. The problem is the file has lot of junk character in it,how to avoid it. The... (2 Replies)
Discussion started by: nathgopi214
2 Replies

3. Shell Programming and Scripting

Reading a file having junk characters in perl

Can anyone tell me how to read a file in perl having junk characters . I have only one junk character which is repeated many times in the file. While i'm reading and printing the file , it is displaying till the 1st occurence of that junk character and rest of the file is not being read. (1 Reply)
Discussion started by: k_surya
1 Replies

4. Shell Programming and Scripting

Remove all JUNK character from file.

Hi Team, I have a file having size greater than 1 GB. What i want to do is to check if it contains any JUNK character (ie any special charater thats not on the key board stroke). This file has 532 column & seperated with ^~^. I have found some solution from the file, but it is for a... (4 Replies)
Discussion started by: Amit.Sagpariya
4 Replies

5. Shell Programming and Scripting

bash-gnuplot: unexpected end of file

Hi I can't figure out why i get the "unexpected end of file". #! /bin/bash for file1 in /figures/*; do gnuplot << EOF set terminal postscript eps color enhanced set output "$file1.eps" set bar 1.000000 ... (2 Replies)
Discussion started by: Dedalus
2 Replies

6. UNIX for Dummies Questions & Answers

how to grep junk characters in a file

hi guys, I am generating a file from datastage (an etl tool). Now the file is having some junk characters like ( Á,L´±,ñ and so on).. I want to use the grep function to figure out all the junk characters and their location. Can somebody help me out in finding it out.. if possible i... (1 Reply)
Discussion started by: mac4rfree
1 Replies

7. Shell Programming and Scripting

Check Junk character in sql file

Hello, I have two .sql files which I transferred from Windows to Unix (Linux Enterprise Linux Server release 5.3).I want to ensure that these two files have no junk characters in them.How do I do it in the simplest possible way? Many thanks DJ (1 Reply)
Discussion started by: Digjoy83
1 Replies

8. Shell Programming and Scripting

Remove all junk characters from a text file

I am using flatfile, in that flat file we are getting the junk chars 1)I21001f<82>^Me<85>!h49 Service Charge 2) I21001f‚ e...!h49 Service Charge please tell me how to remove all junk chars in unix scripts. (1 Reply)
Discussion started by: Talari
1 Replies

9. Shell Programming and Scripting

How to see junk character in file in.?

Hi I want to know how to see junk character in a file. i am not able to see junk character using vi or cat command. below is the junk char . which i see in host file 10.178.14.67▒▒▒ ac01sp02-vip actually it should be like this 10.178.14.67 ac01sp02-vip i am using secure CRT... (11 Replies)
Discussion started by: scriptor
11 Replies

10. UNIX for Beginners Questions & Answers

awk spitting columns

if i have +2, i want this to be + 2 as separate columns. Doing this for a large column so I cannot do it manually. (3 Replies)
Discussion started by: ripchint
3 Replies
XPL2GPL(1)						      General Commands Manual							XPL2GPL(1)

NAME
xpl2gpl - Convert tcptrace-style xplot input to gnuplot input. SYNOPSIS
xpl2gpl [-s] <file_name> DESCRIPTION
xpl2gpl is a utility that converters tcptrace-style xplot input to gnuplot input. This converter gives a nearly perfect gnuplot reproduc- tion of the corresponding xplot graph. OPTIONS
-s Seperate files. If you wish to plot only some data from the xpl file, you may use the -s option, which generates a bunch of data- files filtered based on the color and plotting style. EXAMPLES
xpl2gpl foo.xpl This would produce files by the names "foo.gpl", "foo.datasets" and "foo.labels". Load the file "file_name.gpl" in gnuplot and it should give you the plot. NOTES
xpl2gpl is provided for convenience, as gnuplot is more commonly installed than the xplot package that tcptrace typically expects, and because xplot has not always been available in Debian. If possible, you should consider installing the xplot-xplot.org package and using it instead of using xpl2gpl. AUTHOR
Avinash Lakhiani (no known email address) This manual page was written by Noah Meyerhans <noahm@debian.org> for the Debian project and may be used freely and without restriction by others. SEE ALSO
tcptrace(1) Aug 8, 2009 XPL2GPL(1)
All times are GMT -4. The time now is 07:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy