Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#371 sorting and loading a dataset before plot

open
nobody
None
5
2013-09-12
2013-08-15
Karl Ratzsch
No

I find that i often have to keep multiple copies of my data files with different sortings, splittings into blocks and datasets, etc.

This uses quite some space, and tends to mess up my hard drive, apart from eating a lot of time to do the sorting.

I therefore propose a load/sort command for gnuplot, that creates the dataset to be plotted online. Possible syntax could be

sort "filename" [index ..] [every ..] [using ..] by n,m:o:p

where the sorting is first done over column n, each new n starting a new dataset,
then col(m), each new m starting a new dataset,
then col(o), each new o starting a new block,
and finally column p.

Minus sign before column numbers means inverse sorting.

Advantage to using an external program, creating temporary files, would be that i can already do some math before the sorting, with the familiar "using" construction.

Discussion

  • Ethan Merritt
    Ethan Merritt
    2013-09-11

    Please expand on your suggestion.
    What would happen to this sorted data?
    How is this different from "plot FILE [using...] smooth unique"?

     
  • Karl Ratzsch
    Karl Ratzsch
    2013-09-12

    I thought the data would be sorted to some dataset structure in memory, perhaps make it a special variable type that can be given to "plot" instead of a filename string. Optionally this could also be a temporary file for people with huge datasets.

    (Or do it with an old favourite of mine, array variables! ;-)
    Add option "to array1:array2:.." to the proposed sort command, and then do
    "plot using (array1[$0]):(array2[$0])" )

    Doing the sorting via "every" and "smooth unique" fails if the dataset wasn´t built regularily (all subsets having the same number of entries), or if i want to sort to something else than abscissa values.