Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #1131
| From | Olaf Schultz <o.schultz@enhydralutris.de> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: Question about sprintf |
| Date | 2012-05-20 21:28 +0200 |
| Message-ID | <a1suu0FqfpU1@mid.individual.net> (permalink) |
| References | <a089taFbvkU1@mid.individual.net> <jnnkoc$2nt$1@dont-email.me> |
sfeam wrote:
> Olaf Schultz wrote:
>
>> Moin moin,
>>
>> I'am currently using 4.4 pl0 and want to do something like
>>
>> plot "foo.dat" u 4:5, "" u 4:5:(sprintf("%8s:%5s",$6,$7)) w labels
>>
>> where $6 and $7 are string-data, no numerical data. But with %s,
>> known from fprint in awk, it does not work. The man-page for sprintf
>> didn't helped...
>
> $6 is shorthand for column(6), which returns a numeric value.
> The equivalent for string data is stringcolumn(6), for which
> the shorthand is strcol(6)
Thanks, that works
"" u 4:5:(sprintf("%s_%s",strcol(6),strcol(7)))
does exact that, what I want.
Greetings,
Olaf
PS: It's every time a big fun to infect to Excel-bounded colleques with
the gnuplot-virus:-)
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Find similar
Question about sprintf Olaf Schultz <o.schultz@enhydralutris.de> - 2012-04-30 22:10 +0200
Re: Question about sprintf sfeam <sfeam@users.sourceforge.net> - 2012-04-30 20:19 -0700
Re: Question about sprintf Olaf Schultz <o.schultz@enhydralutris.de> - 2012-05-20 21:28 +0200
csiph-web