1

I want to scale my "y" data with some function in Gnuplot.

My data file "LB.dat"

 #x            #y
0.393000E+01 0.777894E+01
0.394000E+01 0.878703E+01
0.395000E+01 0.995059E+01
0.396000E+01 0.113780E+02
0.397000E+01 0.132372E+02
0.398000E+01 0.158209E+02
0.399000E+01 0.197064E+02
0.400000E+01 0.261749E+02
0.401000E+01 0.378215E+02
0.402000E+01 0.413921E+02
0.403000E+01 0.187385E+01
0.404000E+01 0.479743E+01
0.405000E+01 0.209362E+02
0.406000E+01 0.615307E+02
0.407000E+01 0.192419E+03
0.408000E+01 0.822545E+02
0.409000E+01 0.147813E+02
0.410000E+01 0.253664E+01
0.411000E+01 0.964172E-01
0.412000E+01 0.443564E+00

I want to scale my "y" data using the function exp(-a*"y") where 'a' is some constant.

Here is my script file.

set terminal postscript eps enhanced "Helvetica" 18 color
set output "scaling.eps"
set size 1,1
set xlabel "x" font "Helvetica,22"
set xrange[0:100]
set logscale y
set format y "10^{%L}"
set ylabel "y" font "Helvetica,22"

plot "LB.dat" using 1:exp(-0.5*$2) w l lw 1.5 lc 'blue' title "scaledLB"

When I run it I am getting an error message " plot "LB.dat" using 1:exp(-0.5*$2) w l lw 1.5 lc 'blue' title "scaledLB"

                               ^
     "scale.gp", line 13: undefined value "

Please help me resolve this issue.

1 Answer 1

2

if you are using a formula with columns put the whole expression into (), i.e. (exp(-0.5*$2))

plot "LB.dat" using 1:(exp(-0.5*$2)) w l lw 1.5 lc 'blue' title "scaledLB"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.