Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #1487
| From | Brendan Halpin <brendan.halpin@ul.ie> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: Plotting frequency of word occurences |
| Date | 2012-11-13 21:11 +0000 |
| Message-ID | <878va58ay0.fsf@wivenhoe.ul.ie> (permalink) |
| References | <41723be4-5840-4ecb-9a4c-91a710117d9f@googlegroups.com> |
On Tue, Nov 13 2012, hogiaus@gmail.com wrote: > This seems like it should be dead simple, but extensive googleing has > yielded no results. Say I have a datafile like so: > > ----- > neutron > neutron > e- > proton > [Li]8 > neutron > [Si]28 > [Li]8 > e- > ----- > > And I want to make a histogram that will determine all unique strings, > and display the counts of each one, e.g. 3 neutron, 2 e-, 1 proton, 2 > [Li]8, 1 [Si]28. If you're in a unixy environment, first process your data using shell commands: sort particles.dat | uniq -c > pcount.dat Then (derived from http://www.dcs.bbk.ac.uk/~gzoum01/howtos/gnuplot_barcharts.html), in gnuplot: gnuplot> set boxwidth 1 relative gnuplot> set style data histograms gnuplot> set style fill solid 1.0 border -1 gnuplot> plot [][0:] "pcount.dat" using 1:xticlabels(2) Brendan -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F1-009 x 3147 mailto:brendan.halpin@ul.ie ULSociology on Facebook: http://on.fb.me/fjIK9t http://teaching.sociology.ul.ie/bhalpin/wordpress twitter:@ULSociology
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Next in thread | Find similar
Plotting frequency of word occurences hogiaus@gmail.com - 2012-11-13 12:36 -0800
Re: Plotting frequency of word occurences Brendan Halpin <brendan.halpin@ul.ie> - 2012-11-13 21:11 +0000
Re: Plotting frequency of word occurences Brendan Halpin <brendan.halpin@ul.ie> - 2012-11-13 21:17 +0000
Re: Plotting frequency of word occurences hogiaus@gmail.com - 2012-11-13 16:20 -0800
csiph-web