Gnuplot spitting junk to CL, saying file not found

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Gnuplot spitting junk to CL, saying file not found
# 1  
Old 12-02-2013
Wrench Gnuplot spitting junk to CL, saying file not found

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:

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

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"


Last edited by bartus11; 12-02-2013 at 06:47 PM.. Reason: Please use code tags
# 2  
Old 12-02-2013
A quote too many in
set output "accidents_"$Postocode.png"

This User Gave Thanks to MadeInGermany For This Post:
# 3  
Old 12-03-2013
Originally Posted by MadeInGermany
A quote too many in
set output "accidents_"$Postocode.png"

Damn, I knew it would be something simple.Smilie
Just in case anyone else reads this, I also messed around with the order of the things I am setting.
Changing them to this order worked:
 Set terminal <type> size <x> <y>
 Set output "outputname"
 Set data style <type>

everything else the same order Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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▒▒▒ ac01sp02-vip actually it should be like this ac01sp02-vip i am using secure CRT... (11 Replies)
Discussion started by: scriptor
11 Replies

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. Shell Programming and Scripting

Junk Character in file

Hi set filename "./" if } err] { writeLog "error in exec " writeLog $a } else { writeLog $a } The above code will execute a file,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

10. 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
Login or Register to Ask a Question