[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info
Subject:    dynamic filename setting
From:       "Lauren Clarke" <lauren () cornerstonenw ! com>
Date:       2000-11-14 12:04:47
[Download RAW message or body]

Hello All, 

Some help requested:

Is is possible to dynamically set the output file?

For example:

Plotter = 

c_p = c_p+1
plot [-pi:pi] [n_p/10:-n_p/10] (c_p/10)*sin(x-c_p/pi)
if(c_p <  n_p) reread

And we call it thus:

n_p=20
c_p=1
set nokey
call 'plotter' 


If I wanted to store each plot in a separate file, is something like this 

Plotter = 

c_p = c_p+1
set output 'plot'+c_p+'.gif'    #Which doesn't work of course... 
plot [-pi:pi] [n_p/10:-n_p/10] (c_p/10)*sin(x-c_p/pi)
if(c_p <  n_p) reread

possible?

Essentially I need integer to string conversion (either that or some sort of \
overloaded + operator) and the ability to set output STRINGVAR .  TIA
-lc


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello All, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Some help requested:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Is is possible to dynamically set the output 
file?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>For example:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Plotter = </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>c_p = c_p+1<BR>plot [-pi:pi] [n_p/10:-n_p/10] 
(c_p/10)*sin(x-c_p/pi)<BR>if(c_p &lt;&nbsp; n_p) reread<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>And we call it thus:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>n_p=20<BR>c_p=1<BR>set nokey<BR>call 'plotter' 
<BR></DIV>
<DIV></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>If&nbsp;I wanted to store each plot in a separate 
file, is something like this </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Plotter = </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>c_p = c_p+1</FONT></DIV>
<DIV><FONT face=Arial size=2>set output 'plot'+c_p+'.gif'&nbsp;&nbsp;&nbsp; 
#Which doesn't work of course... <BR>plot [-pi:pi] [n_p/10:-n_p/10] 
(c_p/10)*sin(x-c_p/pi)<BR>if(c_p &lt;&nbsp; n_p) reread<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>possible?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>Essentially I need integer to string conversion (either that or some sort 
of overloaded + operator) and the ability to set output STRINGVAR . </DIV>
<DIV><FONT face=Arial size=2>TIA</FONT></DIV>
<DIV>-lc</DIV>
<DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT></DIV></FONT></BODY></HTML>

 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot
to majordomo@dartmouth.edu
]]]]


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic