|
From: Theo <th...@gm...> - 2014-01-22 21:50:25
|
Hi there, if I want to include (for some special reason) data into the plotting file itself I can use the special filename '-' and write the data in the plot file, e.g.: plot '-' u 0:1 w l lc 1 10 20 30 40 e If I want to use the data twice and modify it in the second plot I thought that I can use the special filename '', which according to the manual should "...re-use the previous input file in the same plot command." The previous input file is '-'. As I understand this data should be re-used. Factor=1.234 Offset=9.876 plot '-' u 0:1 w l lc 1, '' u 0:($1*Factor+Offset) w l lc 2 10 20 30 40 e But it doesn't. I get the message "warning: Skipping data file with no valid points" Obviously, I have to type in the same data twice: Factor=1.234 Offset=9.876 plot '-' u 0:1 w l lc 1, '' u 0:($1*Factor+Offset) w l lc 2 10 20 30 40 e 10 20 30 40 e Why can't I use the same data twice? Can anybody explain? Is there a way that I have to type in the data only once? |
|
From: Tait <gnu...@t4...> - 2014-01-23 01:31:43
|
The '' syntax re-uses the file name, not the file data. With a normal file the '' actually re-reads the file again, which is why when gnuplot goes to re-read from inline you must re-supply the data. To reuse the file's data, gnuplot would obviously have to cache it, and that is impractical or impossible for large data sets. I think I recall some discussion along the lines of implementing a named data store feature that would explicitly instruct gnuplot to cache a particular (potentially inline) data set, but I'm not sure whether it was completed. To only type in the data once, put it into a regular file with the appropriate format, and reference it by its file name. Theo <th...@gm...> said (on 2014/01/22): > Hi there, > > if I want to include (for some special reason) data into the plotting > file itself I can use the special filename '-' and write the data in the > plot file... > > Why can't I use the same data twice? Can anybody explain? > Is there a way that I have to type in the data only once? |
|
From: Theo <th...@gm...> - 2014-01-23 05:47:10
|
Thank you for your explanations. That's a pity. I didn't want to attach a lot of small separate data files to the plotting file. Although it might be possible to somehow pack the different smaller datasets in one file but it will not be convenient for plotting. Another approach: Like the variable in gnuplot, can single column data be defined in an inline array? e.g. 'MyValue=3.141' and 'MyArray'=(10,20,30,40,50) Is this what you meant with "named data store"? Am 23.01.2014 02:07, schrieb Tait: > The '' syntax re-uses the file name, not the file data. With a normal > file the '' actually re-reads the file again, which is why when gnuplot > goes to re-read from inline you must re-supply the data. To reuse the > file's data, gnuplot would obviously have to cache it, and that is > impractical or impossible for large data sets. > > I think I recall some discussion along the lines of implementing a named > data store feature that would explicitly instruct gnuplot to cache a > particular (potentially inline) data set, but I'm not sure whether it > was completed. > > To only type in the data once, put it into a regular file with the > appropriate format, and reference it by its file name. > > Theo <th...@gm...> said (on 2014/01/22): >> Hi there, >> >> if I want to include (for some special reason) data into the plotting >> file itself I can use the special filename '-' and write the data in the >> plot file... >> >> Why can't I use the same data twice? Can anybody explain? >> Is there a way that I have to type in the data only once? > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |
|
From: Ethan A M. <eam...@gm...> - 2014-01-23 05:59:19
|
On Thursday, 23 January 2014 01:07:39 AM Tait wrote:
> The '' syntax re-uses the file name, not the file data. With a normal
> file the '' actually re-reads the file again, which is why when gnuplot
> goes to re-read from inline you must re-supply the data. To reuse the
> file's data, gnuplot would obviously have to cache it, and that is
> impractical or impossible for large data sets.
>
> I think I recall some discussion along the lines of implementing a named
> data store feature that would explicitly instruct gnuplot to cache a
> particular (potentially inline) data set, but I'm not sure whether it
> was completed.
Correct.
In 4.7 you can provide named data blocks.
gnuplot> help inline
There are two mechanisms for embedding data into a stream of gnuplot commands.
If the special filename '-' appears in a plot command, then the lines
immediately following the plot command are interpreted as inline data.
See `special-filenames`. Data provided in this way can only be used once, by
the plot command it follows.
The second mechanism defines a named data block as a here-document. The named
data is persistent and may be referred to by more than one plot command.
Example:
$Mydata << EOD
11 22 33 first line of data
44 55 66 second line of data
# comments work just as in a data file
77 88 99
EOD
stats $Mydata using 1:3
plot $Mydata using 1:3 with points, $Mydata using 1:2 with impulses
Data block names must begin with a $ character, which distinguishes them from
other types of persistent variables. The end-of-data delimiter (EOD in the
example) may be any sequence of alphanumeric characters.
Ethan
>
> To only type in the data once, put it into a regular file with the
> appropriate format, and reference it by its file name.
>
> Theo <th...@gm...> said (on 2014/01/22):
> > Hi there,
> >
> > if I want to include (for some special reason) data into the plotting
> > file itself I can use the special filename '-' and write the data in the
> > plot file...
> >
> > Why can't I use the same data twice? Can anybody explain?
> > Is there a way that I have to type in the data only once?
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
|