|
From: H.S. <hs....@gm...> - 2007-07-15 03:21:34
|
Eduard wrote: > > Hi All, > > I am a new user of Gnuplot and I have a basic question. > I want to write a script in csh (c shell) which takes some data from a file > named output.dat and sends it to gnuplot for plotting (a 2D plot). The > output.dat file has 3 columns -x,y,z. I am interested to plot (y+z) as a > function of x. What I did is the following: > ________________________________________________________ > > #!/bin/csh > > set IN = ./output.dat > set OUT = ./output.eps > cat <<EOF | gnuplot > $OUT > set term postscript eps color > set origin 0.0,0.5 > set size 0.5,0.5 > plot "$IN" u 1:(2+3) title "p" with lines > EOF > -------------------------------------------------------------------------------------- > The bolded line is the one which make me difficulties. I have tried to > replace the syntax from -> 1:(2+3) <- > with 1:($2+$3), 1:$(2+3), etc but without any success :(. > > If you could help me to fix this problem it would be really great. Try 1:(\$2 + \$3) instead. That "$" symbol you are using is being interpreted by your shell script. You need to escape that with "\" to make your shell take that as simple text and gnuplot will then recognize it. ->HS > With all the best wishes, > Ed > > > > > > > > > > > > > |