Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #4421
| Path | csiph.com!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail |
|---|---|
| From | Hans-Bernhard Bröker <HBBroeker@t-online.de> |
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: plot for [i = 'list of numbers'] |
| Date | Tue, 13 Jul 2021 14:37:24 +0200 |
| Lines | 21 |
| Message-ID | <il5fo7Fg9ehU1@mid.dfncis.de> (permalink) |
| References | <scjvsl$9af$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | news.dfncis.de aS/k0SYXeY/W+ukYbD+mewEEKunSKTq1Au3bjrAJhjybKgKCk1iANknzaw |
| Cancel-Lock | sha1:4r25uOyL3z2f772/RIPuM8mk87c= |
| User-Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
| In-Reply-To | <scjvsl$9af$1@dont-email.me> |
| Content-Language | en-US |
| Xref | csiph.com comp.graphics.apps.gnuplot:4421 |
Show key headers only | View raw
Am 13.07.2021 um 14:11 schrieb Jörg Buchholz:
> list = "6 8 9"
> plot for [i in list] 'file' skip 6 u 2:i w l t sprintf("T_%i",i-2)
Close, but no cigar. The string-based list does not work like that
because its elements evaluated by the for loop are still strings.
The following would have worked, though:
plot for [i in "6 8 9"] 'file' u 2:int(i)
The following may be more useful. See "help arrays" to understand what
it does:
n = 3
array list[n] = [6, 8, 9]
plot for [i in 1:n] 'file' u 2:list[i]
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Next in thread | Find similar
plot for [i = 'list of numbers'] Jörg Buchholz <bookwood4new@freenet.de> - 2021-07-13 14:11 +0200
Re: plot for [i = 'list of numbers'] Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2021-07-13 14:37 +0200
Re: plot for [i = 'list of numbers'] Jörg Buchholz <bookwood4new@freenet.de> - 2021-07-14 07:07 +0200
csiph-web