|
From: Mauricio G. <ga...@fc...> - 2010-11-13 19:49:25
|
Arnold et al In the link "http://www.fct.unesp.br/docentes/carto/galo/web/gnuplot/gnu_exemplos5.htm" you will find some examples of histograns with the respective gnuplot script. M. Galo > > Hi all, > > I'm a novice with gnuplot and I'm trying to make a histogram or > bar plot > that looks like the following: > http://old.nabble.com/file/p30208070/grades.png > > but I can't for the life of me get a gnuplot script to do this. > I can get > frequency on the y-axis but I want to get a percentage, and my > male/female > columns overlap with the same color on output: > http://old.nabble.com/file/p30208070/grades.jpg > > The data file I'm using has one column of male percentages and > one of female > percentages. Here's my horrible script: > > set term postscript > set output 'grades.ps' > > bin_width = 20.0 > set style fill solid 1.00 border -10 > set style data boxes > #set style boxes cluster gap 1 > set bmargin 10 > set ylabel "Percentage of Students" > set xlabel "Grade Percentage" > set yrange [0.0:140.0] > #set xtics ("100%-125%" 100.0:125.0, "75%-99%" 75.0:99.0, > "50%-74%" > 50.0:74.0, "25%-50%" 25.0:50.0, "0%-24%" 0.0:24.0) > set xtics 20 > bin_number(x) = floor(x/bin_width) > rounded(x) = bin_width * ( bin_number(x)) > UNITY = 1 > plot 'grades_distribution.data' u (rounded($1)):(UNITY) t > 'Male' smooth > frequency w boxes fs solid 5,\ > '' u (rounded($2)):(UNITY) t 'Female' smooth frequency > w boxes fs > solid 3 > > > Any help is greatly appreciated, thanks! > > -- > View this message in context: > http://old.nabble.com/Histogram-Bar-Plot-Troubles-tp30208070p30208070.html > Sent from the Gnuplot - User mailing list archive at > Nabble.com. > > > ------------------------------------------------------------------------------ > Centralized Desktop Delivery: Dell and VMware Reference > Architecture > Simplifying enterprise desktop deployment and management using > Dell EqualLogic storage and VMware View: A highly scalable, > end-to-end > client virtualization framework. Read more! > http://p.sf.net/sfu/dell-eql-dev2dev > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |