Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is wrong with my simple/short script?

6,061 views
Skip to first unread message

Sally

unread,
Jan 26, 2009, 2:09:38 PM1/26/09
to
Hi,

This script has been working fine, and now all of sudden, it is giving
me an error, and
I don't seem to find the reason behind.

My script is :

set terminal jpeg
set nokey
set output "test.jpeg"
set size 1.0, 1.0
set xr [1.e-10:10]
set logscale x 10; set xtics 10
set yr [1e-6:1e-0]
set logscale y 10; set ytics 10
set xl "TIME in seconds"
set yl "ABUNDANCE in Log"

set style line 1 lt 1 lc 1 lw 2 #red
set style line 2 lt 1 lc 2 lw 2 #green
set style line 3 lt 1 lc 3 lw 2 #blue


plot \
"abun_time" every::5 u 4:1 w l ls 1,\
"abun_time" every::5 u 4:2 w l ls 2,\
"abun_time" every::5 u 4:3 w l ls 3


And, I am getting the following error.

gnuplot> plot "abun_time" every::5 u 4:1 w l ls 1,
"abun_time" every::6 u 4:2 w l ls 2,\

^
line 0: invalid character \


gnuplot> "abun_time" every::5 u 4:3 w l ls 3
^
line 0: invalid command


Anyone any idea?

Thank you!

Sally

unread,
Jan 26, 2009, 3:39:01 PM1/26/09
to

Never mind.
I figured out.
There shouldn't be no blank space after "backslash".
Who would've known..(maybe it's just me.)

goo...@catking.net

unread,
Jan 31, 2009, 5:11:20 PM1/31/09
to
On Jan 26, 9:39 pm, Sally <adisn...@hotmail.com> wrote:

> Never mind.
> I figured out.
> There shouldn't be no blank space after "backslash".
> Who would've known..(maybe it's just me.)

Who would've known? He who understood what the backslash was there
for.

The backslash escapes (removes the special meaning of) the following
character. In this case it should be the newline. This means it does
not mean the end of the line, as far as gnuplot is concerned it is one
lone line. If you add a space you get an ignored space and a valid
newline which produces the error you saw. Gnuplot sees a new line and
hence tries to interpret "abun_time" every as a command. The error
makes sense and points you to finding the error.

Though it is difficult to spot the error on the screen until you have
been caught out once, the error is correct and logical. If in doubt
with this sort of problem I backspace the following line until it
joins up then add the backslash and newline afresh.

leili....@gmail.com

unread,
Jun 11, 2014, 7:45:33 AM6/11/14
to
Hi Sally,

Thanks for the solution!
I was stuck with this issue several times :-)

vincen...@gmail.com

unread,
Oct 3, 2014, 4:19:25 AM10/3/14
to
You saved my day.

parsa....@gmail.com

unread,
Mar 29, 2015, 2:03:43 PM3/29/15
to
Dear Sally,

Thank you very very much for this solution. I was getting mad over this.
0 new messages