Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2142
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Michael <proximum@land.ru> |
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: Counting multiple data lines |
| Date | Sun, 13 Oct 2013 02:14:04 +0700 |
| Organization | A noiseless patient Spider |
| Lines | 41 |
| Message-ID | <l3c71s$19m$1@dont-email.me> (permalink) |
| References | <ea268ea1-4f5d-4f2d-bbd5-e604c33c1de9@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Sat, 12 Oct 2013 19:14:04 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="1cdacf49d1e257f7abbe1df614ff1476"; logging-data="1334"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18azyGNZzlPXh6ntT/ztF8b" |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
| In-Reply-To | <ea268ea1-4f5d-4f2d-bbd5-e604c33c1de9@googlegroups.com> |
| Cancel-Lock | sha1:S8+S6uSAoXXtpiaBWNWDdMsQkF0= |
| Xref | csiph.com comp.graphics.apps.gnuplot:2142 |
Show key headers only | View raw
12.10.2013 04:44, Bret Foreman пишет:
> I'm testing a communication channel where I vary 2 parameters, call them X and Y. I include the values of X and Y in the message and I send N messages for each pair of X and Y. Each message either passes through the channel or does not - there are no partial messages. At a given pair of values for X and Y I get N or fewer (or no) successful messages.
>
> My output file consists of rows of successfully received messages with the message data consisting of the values for X and Y. I'd like to create a 3D plot that shows the number of successful messages for each value of X and Y.
>
> For example, I might have this:
>
> 2,3
> 2,3
> 2,3
> 3,3
> 3,3
> 3,3
> 3,3
>
> In this case I want to plot two points, one at (2,3,3) and one at (3,3,4) where the z value is a count of the number of identical lines.
>
> I don't have to worry about non-contiguous sets of identical lines because my source data never does that.
>
> Can anyone suggest a good way to implement this in gnuplot?
>
> Thanks,
> Bret
>
Here is a little perl script for you (but you can also write it on the
language you prefer).
If your system is not Linux, your problem will be a bit more complex.
#!/usr/bin/perl -w
use strict;
my @unique=`uniq <arr.dat`;
my $a;
open OUTFILE, ">res.dat";
for my $u (@unique)
{
chomp $u;
$a = "$u," . `grep "$u" arr.dat |wc -l`;
print OUTFILE $a;
}
close OUTFILE;
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Find similar | Unroll thread
Counting multiple data lines Bret Foreman <bret.foreman@gmail.com> - 2013-10-11 14:44 -0700 Re: Counting multiple data lines Michael <proximum@land.ru> - 2013-10-13 02:14 +0700
csiph-web