I am running a program which uses a plotting subroutine for gnuplot. I am running a script and am supposed to view the resultant plot in real time.
Inside the do loop, the plotting command would come up say 100 times. Because of this I am obtaining 100 seperate gnuplot windows containing the plot.
The program is like
do i=1,100
...
...
call plota1(x,y)
end do
Is there any way such that I do not get such 100 plots,only one, and say, when the (i+1)th plot comes, it will come in the same gnuplot window replacing the ith plot?
The plotting subroutine used is as follows.
subroutine plota1(x,y)
real*8::x(:),y(:)
integer l,u,i
l=lbound(x(:),dim=1)
u=ubound(x(:),dim=1)
open(1,file="p.dat")
open(2,file="p.plt")
do i=l,u
write(1,*) x(i),y(i)
end do
write(2,*) "p 'p.dat' u 1:2 w l"
call execute_command_line('gnuplot -p p.plt')
close(1,status='delete')
close(2,status='delete')
end subroutine plota1
The plotting command comes from the line "write(2,*) "p 'p.dat' u 1:2 w l"". What should I add there to get the desired output? If there is no way, suggestions for using some other software will also be helpful.