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


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

Re: Line type defined by data

From Janis Papanagnou <janis_papanagnou@hotmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Line type defined by data
Date 2015-08-15 23:43 +0200
Organization Aioe.org NNTP Server
Message-ID <mqobpq$9r6$1@speranza.aioe.org> (permalink)
References <mqm0a7$bql$1@speranza.aioe.org> <d38j88Fhs5tU1@mid.dfncis.de> <mqn6a4$khd$1@speranza.aioe.org> <mqnu9j$7c7$1@dont-email.me>

Show all headers | View raw


On 15.08.2015 19:54, Ethan A Merritt wrote:
> Janis Papanagnou wrote:
> 
>> On 15.08.2015 12:40, Hans-Bernhard Bröker wrote:
>>> Am 15.08.2015 um 02:15 schrieb Janis Papanagnou:
>>>> Currently I am splitting my original data (three columns: date,
>>>> amount, type)
>>>
>>>> Is it possible to avoid the preprocessing of the original data and
>>>> directly
>>>> determine the line type depending  on column 3 in the data file,
>>>
>>> That depends on what that column three actually contains.
>>
>> Currently teh data is like this
>>
>>    20050723 5470 1     or    20050723 5470 0
>>
>> Column three is under my control. It may contain anything like
>>
>>    20050723 5470 true  or    20050723 5470 false
>>    20050723 5470 red   or    20050723 5470 green
>>    20050723 5470 1     or    20050723 5470 2
>>
>> i.e., I can adjust it if gnuplot has some demands on the specific
>> data.
>>
>>> It might be as
>>> simple as specifying an "every" option, or you could use the ternary
>>> operator, or filter the file on-the-fly using the "< ..." special
>>> file.
>>
>> Could you please be more concrete; how would that look like?
> 
> 
>  plot '< grep green datafile.dat'
> 
> or
> 
>  plot 'datafile.dat' using 1:(strcol(3) eq "green" ? $2 : NaN)

Thanks for your reply. Do I interpret that code correctly; the first one
triggers an external command to read only the respective matching lines
from the data file, and the second one compares data column 3 gainst the
string ("green" in this case) and provides only the data field 2 to plot
if it matches, and "NaN" will make the plot command ignore that point?
If my interpretation is correct, I will need with either variant two plot
specifications, one to grep green and one to grep red, and respectively
similarly with the ternary operation. Right? Thanks!

Janis

> 
>>
>> Janis
> 

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


Thread

Line type defined by data Janis Papanagnou <janis_papanagnou@hotmail.com> - 2015-08-15 02:15 +0200
  Re: Line type defined by data Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2015-08-15 12:40 +0200
    Re: Line type defined by data Janis Papanagnou <janis_papanagnou@hotmail.com> - 2015-08-15 13:03 +0200
      Re: Line type defined by data Ethan A Merritt <EAMerritt@gmail.com> - 2015-08-15 10:54 -0700
        Re: Line type defined by data Janis Papanagnou <janis_papanagnou@hotmail.com> - 2015-08-15 23:43 +0200
          Re: Line type defined by data Ethan A Merritt <EAMerritt@gmail.com> - 2015-08-15 20:32 -0700
            Re: Line type defined by data Janis Papanagnou <janis_papanagnou@hotmail.com> - 2015-08-16 14:28 +0200
              Re: Line type defined by data Janis Papanagnou <janis_papanagnou@hotmail.com> - 2015-08-16 15:45 +0200
                Re: Line type defined by data Karl-Friedrich Ratzsch <mail.kfr@gmx.net> - 2015-08-16 17:12 +0200
                Re: Line type defined by data Janis Papanagnou <janis_papanagnou@hotmail.com> - 2015-08-17 16:06 +0200

csiph-web