Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2968

Re: how to reference same data set in script twice?

From Karl Ratzsch <mail.kfr@gmx.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: how to reference same data set in script twice?
Date 2015-07-07 18:24 +0200
Organization solani.org
Message-ID <mngufb$rtn$1@solani.org> (permalink)
References <f2050fa4-92ed-46cb-8b25-9f3e50b39be8@googlegroups.com> <mn9teh$d1l$1@solani.org> <mngogm$ku1$1@dont-email.me>

Show all headers | View raw


Am 07.07.2015 um 16:43 schrieb Ethan A Merritt:
> Karl-Friedrich Ratzsch wrote:
> 
>> Am 04.07.2015 um 08:13 schrieb thomas.lehmann.private@googlemail.com:
>>> Hi,
>>>
>>> what I'm looking for is an elegant way to reference same
>>> data twice (no file). I have a Python wrapper for plots and
>>> the final script which result looks like (see bottom) ...
>>
>> Very simple if you have gp version > 5.0
>>
>> set table $data
>> plot "-"
>> unset table
>> fit ... $data ...
>> plot $data, ...
> 
> I wouldn't recommend that, since the tabling operation
> only preserves some of the information in the original
> input stream.  Much better is to use the version 5
> "Here Document" method:
> 
> 
> $DATA_1 << EOD
> 1 2 3 # first line of data
> 3 4 5 8 9 
> EOD
> 
> $DATA_2 << EOD
> 5 6 7
> 8 9 0
> EOD
> 
> plot $DATA_1 using 1:2, $DATA_1 using 1:3, $DATA_2
> 

That's right. If you already have a Python wrapper, there's no need to
use table mode for filling $DATA. Definitely more elegant.

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Find similar


Thread

how to reference same data set in script twice? thomas.lehmann.private@googlemail.com - 2015-07-03 23:13 -0700
  Re: how to reference same data set in script twice? Karl-Friedrich Ratzsch <mail.kfr@gmx.net> - 2015-07-05 02:23 +0200
    Re: how to reference same data set in script twice? Ethan A Merritt <EAMerritt@gmail.com> - 2015-07-07 07:43 -0700
      Re: how to reference same data set in script twice? Karl Ratzsch <mail.kfr@gmx.net> - 2015-07-07 18:24 +0200

csiph-web