Question

I have a shell script that performs some calculations and plot the results. I have used gnuplot for plotting the results. I'm facing two problems. I used to run the script on my cygwin and it's Okay. When I tried to run it on Ubuntu (Version 10.04-wubi-version), it couldn't recognize the png files (set terminal png unknown). I have tried to install (missing libraries that support "libgd2_2.0.36~rc1~dfsg" and update the libraries.... no luck !! then I have decided to use set terminal pdf instead since I found it supported :

here is my gnuplot version:

G N U P L O T
Version 4.4 patchlevel 0
last modified March 2010
System: Linux 2.6.35-32-generic

here is the output of terminal types:

      latex  LaTeX picture environment
      mf  Metafont plotting standard
      mif  Frame maker MIF 3.00 format
      mp  MetaPost plotting standard
      nec_cp6  NEC printer CP6, Epson LQ-800 [monocrome color draft]
      okidata  OKIDATA 320/321 Standard
      pbm  Portable bitmap [small medium large] [monochrome gray color]
      pcl5  HP Designjet 750C, HP Laserjet III/IV, etc. (many options)
      -->pdf  PDF (Portable Document File) file driver
      postscript  PostScript graphics, including EPSF embedded files (*.eps)
      pslatex  LaTeX picture environment with PostScript \specials
      pstex  plain TeX with PostScript \specials

Now, After I have modified the shell script to use pdf, I'm getting this error (Note: some of the pdf files are created ).

line 0: ';' expected

Again, I've added ';' to all of the lines.... and the error still appears.

Here is part of my shell script (that gives the error):

  gnuplot << TOEND ;
  set terminal pdf;
  set output 'A.pdf';
  set autoscale ;                        
  #unset log                              
  #unset label                            
  set xtic auto ;                         
  set ytic auto  ;                        
  set title "title";
  set xlabel "x axis";
  set ylabel "y axis";
   ######################################
   #UPDATE: I have added double space to a void the error  
   ######################################
   plot "A1.tr" using 1:2 title "A" with lines 9,  \  
    "A2.tr" using 1:2 title "B" with lines 11       

the output (Note this part is not of the created pdf files):

line 0: invalid character \ --->pointing to 9, \
line 0: invalid command --->poiting to A2.tr

the rest of shell script produces the same error (Note: output is created)

......
......
######################################
#UPDATE:  @psibar pointed that 'ls' missing    
######################################
plot "results.tr" using 1:2 title "Results" with lines ls 9;
                                                                           ^
line 0: ';' expected---> pointing to 9 ;

After long searching, I think the problem has to do with version of UBUNTU and Gnuplot....I don't want to upgrade my version of ubuntu.....

After solving the errors. Any suggestions on how to get the "set terminal png" works on ubuntu 10.04 ??

Was it helpful?

Solution

To solve the problem I have added ls and double spaces after the 9, \.

The final answer would be :

gnuplot << TOEND ;
set terminal pdf;
set output 'A.pdf';
set autoscale ;                        
#unset log                              
#unset label                            
set xtic auto ;                         
set ytic auto  ;                        
set title "title";
set xlabel "x axis";
set ylabel "y axis";
######################################
#UPDATE: I have added double space to a void the error 
# and @psibar pointed that 'ls' was missing
######################################
plot "A1.tr" using 1:2 title "A" with lines ls 9,  \  
"A2.tr" using 1:2 title "B" with lines 11       
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top