CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

GNU Plot doubt

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2007, 15:11
Default GNU Plot doubt
  #1
Renato.
Guest
 
Posts: n/a
Hi folks,

some time ago I did something in GNU Plot that I can't remember. I loaded a data file which was still being written and after each update GNU plot automatically reloaded and refreshed the resulting plot. Does anyone know which command is used for doing it?

Thanks

Renato.

  Reply With Quote

Old   February 27, 2007, 16:37
Default Re: GNU Plot doubt
  #2
Balduin Bankerotti
Guest
 
Posts: n/a
c Fortran-gnuplot interaction for real-time animation using named pipe
c
c This is a simple example of how gnuplot can be used to create
c real-time animation of data produced by running fortran 77 code.
c
c I put it in the searchable directory in a hope that it can be useful,
c but no guarantees of any kind: use it at your own risk. Too many
c frames per second can hang you system heavily.
c
c To understand how it works, you need to know what a named pipe is, and what
c plot '-' means in gnuplot: read the manuals.
c
c And, PLEASE, if you know why a.out > FIFOfile works
c but just a.out does not
c even though the gnuplot commands are written to the pipe and not
c to the standard output, send me an explanation to
c chernysh@soton.ac.uk (Sergei Chernyshenko) or
c by other means, see http://www.afm.ses.soton.ac.uk/ -> People.
c
c How to use:
c
c at the linux command prompt, type mkfifo FIFOfile
c compile this file and name the executable a.out .
c in an xterm window type gnuplot < FIFOfile
c in another window type a.out > FIFOfile
c enjoy
c
c do not use too many frames per second, the computer may hang.
c
c second(x) gives the CPU time in seconds. Replace if unavailable.

nframe=0
open(1,file='FIFOfile', status='unknown')
write(1,*) 'set xrange [-10:10]'
write(1,*) 'set yrange [-2:2]'
write(1,*)'set title \'Demonstrating animation Fortran-gnuplot'
1 ,' via named pipe\''
close(1)
1 call second(x)
c 15 frames per second:
if(15*x.gt.nframe) then
nframe=nframe+1
open(1,file='FIFOfile', status='unknown')
write(1,*) 'plot sin(x-',x,'),',' \'-\' w lp'
write(1,*) 0.2
write(1,*) 0.3
write(1,*) 0.4
write(1,*) 0.5
i=(x/10)
i=i*10
write(1,*) (x-i)/10.
write(1,*) 0.7
write(1,*) 0.8
write(1,*) 0.9
write(1,*) 'e'
close(1)
endif
goto 1
stop
end
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plot on a curve Monica FLUENT 1 July 11, 2012 01:24
A girl fail to plot velocity profile when mesh changes + Wall function asherah STAR-CCM+ 0 February 19, 2010 18:45
Transfer low-res graphic file plot to excel plot quarkz Main CFD Forum 3 April 9, 2009 14:54
graph plot anindya Main CFD Forum 2 September 17, 2003 13:00
why can't I plot Y+ value? Jiaying Xu Siemens 2 August 18, 2001 11:56


All times are GMT -4. The time now is 01:56.