Welcome to my homepage!

I am a postdoc at ICTS, Bangalore. Prior to this I was a graduate student at the Physics Department, IISc. Here I would like to share some tricks I use in some of my research with latex, gnuplot, vim etc. Hopefully, it may come in handy to someone else as well. Cheers!


Discontinuous patches in surface plot


Sometimes surface plots (Plot3D) in Mathematica can show discontinuous patches.

Use exclusions none (Make sure the exclusions are unphysical)


Plot3D[Re[Bands[J1val, J2val, kxval, kyval]], {kxval, kxv – delta,
kxv + delta}, {kyval, kyv – delta, kyv + delta}, Exclusions -> None]

courtesy and more details:


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