Received: by 10.66.85.136 with SMTP id h8mr5058380paz.46.1350490375351; Wed, 17 Oct 2012 09:12:55 -0700 (PDT) Received: by 10.68.135.103 with SMTP id pr7mr4379793pbb.7.1350490375336; Wed, 17 Oct 2012 09:12:55 -0700 (PDT) Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!kt20no2469497pbb.1!news-out.google.com!s9ni17751pbb.0!nntp.google.com!kr7no2704986pbb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.graphics.apps.gnuplot Date: Wed, 17 Oct 2012 09:12:55 -0700 (PDT) In-Reply-To: <507E7989.1050103@gmx.eu> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=67.139.44.50; posting-account=hX_sZQoAAABWpVevc7t4N0WZLqu-l6ur NNTP-Posting-Host: 67.139.44.50 References: <507E7989.1050103@gmx.eu> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Histogram for irregular data From: schickb@gmail.com Cc: schickb@gmail.com Injection-Date: Wed, 17 Oct 2012 16:12:55 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.graphics.apps.gnuplot:1414 On Wednesday, October 17, 2012 2:25:25 AM UTC-7, Hermann Peifer wrote: > > With a reasonable data file size, I would pre-process the data on the > fly, perhaps in this way: > > plot "<( awk '{a[$1]=a[$1] FS $2}END{for (i in a) print i, a[i]}' file > )" using ... > > The above AWK one-liner prints your sample data like this: > > IL 2 > OH 3 1 > WA 1 2 1 > Thanks. That is what I was trying to avoid... but I guess its workable. What would the rest of that plot line look like for an unknown/variable number of columns? Or should I use the zero fill trick and count the number of column during pre-processing?