gnuplot script file

do for [a=1000:2000] {
set term x11 0
pl ‘./GenEigfun_107.txt’ u 1:2:3 every :::a::a w p pt 7 ps 2 palette t sprintf(“%.3f”,a)
set term x11 1
set arrow from a, graph 0 to a, graph 1 nohead
pl ‘./GenEigen_107.txt’ u 3 w p t sprintf(“%.3f”,a)
unset arrow
pause 0.5
}

opens two windows, plots the eigenfucntions (1000-2000) as you move through the eigenvalues

plot (and watch) a data movie in gnuplot

Imagine you have  a data file with some parameter changing. And a 2d plot corresponding to each value of this parameter.

Now say, you save a data file data.txt, with multiple blocks(each block should be separated from each other by a single line). And each block corresponds to a unique value of that parameter.

Now you want to see live, how the two d plot changes with this parameter slowly changing. (this parameter could very well be time)

The do for loop in gnuplot is very powerful..

say ‘a’ was that parameter

the every command chooses block by block

pause command waits for 0.5 seconds (can be tuned)

save the following commands in a file and run it using gnuplot.

In order to make  a movie one can save each of these files and then make movie using other software

———————–

do for [a=1:100] {
pl ‘./data.txt’ u 1:2:3 every :::a::a w p pt 7 palette
pause 0.5
}

—————————

 

make both point size and point color a function of a variable

This can be useful in plotting the wavefunctions on a bunch of sites. For example say the 1 and 2 column has the x and y coordinates of the sites. The 3 rd column contains the wavefunction amplitude.

pl ‘./fort.80’ u 1:2:($3)*10:3 w p pt 7 ps variable palette

The above command will make both the size of the point and the color bar a function of the wavefunction amplitude.