Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: plot number variable Followup-To: comp.graphics.apps.gnuplot Date: Thu, 31 May 2012 09:19:04 -0700 Organization: gnuplot development team Lines: 35 Message-ID: References: <10024470-1ab0-4059-868d-704feb82e8c4@googlegroups.com> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Thu, 31 May 2012 16:19:07 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="joalffpZlyHxFtpFd/PRrw"; logging-data="6790"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AFqWTjKF+i55QRp5JKKEc" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:n3e3AiANb01ZXPbbH4TCWxsFQ0M= Xref: csiph.com comp.graphics.apps.gnuplot:1167 tom wrote: > Dear all, > I ws wondering if there was the possibility (it night already exists) to > have a variable (a GPVAL_PLOTNUM) with the current plot being plotted when > plotting several files or functions altogether. I try to explain better: > when I plot several files like plot 'file1', 'file2', sin(x) > I would like to have a variable that is 0 for the plot associated to file1 > and 1 for file2 and 2 for sin(x) so on, so that I can use it to do > something like > > plot 'file1' u 1:2:(GPVAL_PLOTNUM) w l palette, 'file2' u > 1:($2+GPVAL_PLOTNUM):(GPVAL_PLOTNUM) w l palette, sin(x*GPVAL_PLOTNUM) > > what do you think? As far as plotting multiple files, this is already supported. Using your example above: gnuplot> filename(i) = 'file'.i gnuplot> plot for [i=1:2] filename(i) u 1:(column(2+i-1)):i w l palette However mixing in a function that uses the same indexing is strange. Is this a real-world requirement? > would it be easy to implement? > could you give me a hint on the source files I have to look at to do some > test? > > many many thanks