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


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

Re: plotting text

Path csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Jörg Buchholz <bookwood4new@freenet.de>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: plotting text
Date Wed, 7 Jun 2023 08:18:13 +0200
Organization A noiseless patient Spider
Lines 29
Message-ID <u5p7f4$12bfs$1@dont-email.me> (permalink)
References <43b043b7-847f-4cd7-8665-65bc3a7bbc94n@googlegroups.com>
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Wed, 7 Jun 2023 06:18:12 -0000 (UTC)
Injection-Info dont-email.me; posting-host="3e8671cc890df7630e04fbd69dc617c7"; logging-data="1125884"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Vd+AHrYu5sqjq+wo/YNOAqVktXfcocEM="
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2
Cancel-Lock sha1:+CPR/dubDlSalI+P0MB77fOgQGo=
In-Reply-To <43b043b7-847f-4cd7-8665-65bc3a7bbc94n@googlegroups.com>
Content-Language de-DE
Xref csiph.com comp.graphics.apps.gnuplot:4525

Show key headers only | View raw


On 06.06.2023 10:25, Jan Schmidt wrote:
> Hi,
> 
> is there a way to plot a datafile with text and replace the text with numbers?
> 
> i.e. the datafile looks like
> 
> 1684746646.005043	open	standby	0.3
> 1684746646.045847	closed	standby	0.2
> 
> and I want a line chart where I can see the movement from "open" to "closed" as a jump.
> 
> plot "datafile" u 1:2 replace("open",1), replace("closed",2) w l, "datafile" u 1:4 w l


1684746646.005043	open	standby	0.1
1684746646.045847	closed	standby	0.2
1684746646.005043	open	standby	0.3
1684746646.045847	closed	standby	0.4
1684746646.005043	open	standby	0.5
1684746646.045847	open	standby	0.6
1684746646.005043	open	standby	0.7
1684746646.045847	closed	standby	0.8

plot [0:1.0][0:2.0] 'file' u 4:(strcol(2) eq "open" ? 1.0:0.0) w histeps



Jörg

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


Thread

plotting text Jan Schmidt <jan.schmidt70@gmail.com> - 2023-06-06 01:25 -0700
  Re: plotting text Jörg Buchholz <bookwood4new@freenet.de> - 2023-06-07 08:18 +0200

csiph-web