Reputation: 333
I have some measured data, experiment.dat
which goes like this:
1 2
2 3
Now I want to plot them via some command line
plot "experiment.dat" using 1:2 title "experiment" with lines lw 3
Is there some way how to scale the different lines with some scaling factor like -1?
Upvotes: 3
Views: 4341
Reputation: 299
You don't need to multiply the column by minus one, you can simply use:
p "experiment.dat" u 1:(-$2)
at least with Version 5.4 works fine.
You can also only use the initial letter of every command.
Upvotes: 1
Reputation: 48440
Yes, you can do any kind of calculations inside the using
statement. To scale the y
-value (the second column) with -1
, use
plot "experiment.dat" using 1:(-1*$2)
Upvotes: 6