|
From: arnold4life <chr...@ho...> - 2010-11-13 16:54:25
|
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. |
|
From: arnold4life <chr...@ho...> - 2010-11-10 20:01:48
|
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/p30183970/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/p30183970/grades.pdf grades.pdf 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-tp30183970p30183970.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2010-11-13 19:21:42
|
maybe you could post the datafile too arnold4life wrote: > > 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-tp30208070p30208901.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: arnold4life <chr...@ho...> - 2010-11-14 17:16:55
|
The datafile just has two columns, the first has male percentages, the second female percentages. Thomas Sefzick wrote: > > maybe you could post the datafile too > > > arnold4life wrote: >> >> 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-tp30208070p30213137.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Vik R. <vi...@mi...> - 2010-11-14 19:14:27
|
When I run a sample contour chart in Excel and in DeltaGraph, I get a different look than I do with the false color map in gnuplot. The Excel and DeltaGraph charts have very straight, angled edges, which my client prefers. The gnuplot chart is in squarish blocks. Is it possible to avoid this squarish blocky look, and to get this look that we find in Excel and Deltagraph charts, with a gnuplot false color or contour chart? Link to Excel sample chart: http://www.market-research-services.com/Temporary/Excel-sample.jpg Link to DeltaGraph sample chart: http://www.market-research-services.com/Temporary/DeltaGraph-sample.jpg Link to Gnuplot sample chart: http://www.market-research-services.com/Temporary/gnuplot-sample.jpg Link to datafile: http://www.market-research-services.com/Temporary/dataFileKey_30 Thanks very much in advance for any info. Best, -Vik gnuplot commands: unset surface unset key set view map set pm3d set palette defined (0 'black', 2 'gray50', 3 'dark-blue', 8.43243243243 'dark-green', 18.972972973 'light-green', 20.5263157895 '#dac000', 30.7894736842 '#fee000', 32.8421052632 '#ff8000', 55.4210526316 '#ff5a00', 66.7105263158 'orange-red', 78 'dark-red') set output '/Applications/Heatmaps/htdocs/ftp/Heatmaps/heatMap_key30.jpg' set term jpeg size 600, 600 enhanced font '/Library/Fonts/arial.ttf' 8 set dgrid3d 400,400 gauss 0.35,0.35 set size square set xtics("" 1, "Day 0" 2, "2-7\ndays" 3, "2\nWeeks" 4, "3\nWeeks" 5, "1\nMonth" 6, "2-3\nMonths" 7, "4-6\nMonths" 8, "7-12\nMonths" 9, "1 Year+" 10 ) set title '{/=18 Chart Title}' offset 0, .5 set ylabel '{/=16 Degree of Influence}' offset -1.6, 0 set xlabel '{/=16 Days from Purchase}' offset 0,-1.6 set xtics out nomirror set ytics out nomirror set ytics("" 0, "1" 1, "2" 2, "3" 3, "4" 4, "5" 5, "6" 6, "7" 7, "8" 8, "9" 9, "10" 10, "" 11) set y2tics("" 0, "1" 1, "2" 2, "3" 3, "4" 4, "5" 5, "6" 6, "7" 7, "8" 8, "9" 9, "10" 10, "" 11) set xrange [0:11] reverse set yrange [0:11] splot [1:] '/Applications/Heatmaps/htdocs/ftp/Heatmaps/dataFileKey_30' matrix replot |
|
From: arnold4life <chr...@ho...> - 2010-11-15 02:59:11
|
How does this relate to my original post...? Vik_R wrote: > > When I run a sample contour chart in Excel and in DeltaGraph, I get a > different look than I do with the false color map in gnuplot. The Excel > and DeltaGraph charts have very straight, angled edges, which my client > prefers. The gnuplot chart is in squarish blocks. Is it possible to avoid > this squarish blocky look, and to get this look that we find in Excel and > Deltagraph charts, with a gnuplot false color or contour chart? > > Link to Excel sample chart: > http://www.market-research-services.com/Temporary/Excel-sample.jpg > > Link to DeltaGraph sample chart: > http://www.market-research-services.com/Temporary/DeltaGraph-sample.jpg > > Link to Gnuplot sample chart: > http://www.market-research-services.com/Temporary/gnuplot-sample.jpg > > Link to datafile: > http://www.market-research-services.com/Temporary/dataFileKey_30 > > Thanks very much in advance for any info. > > Best, > > > -Vik > > > > > gnuplot commands: > unset surface > unset key > set view map > set pm3d > set palette defined (0 'black', 2 'gray50', 3 'dark-blue', 8.43243243243 > 'dark-green', 18.972972973 'light-green', 20.5263157895 '#dac000', > 30.7894736842 '#fee000', 32.8421052632 '#ff8000', 55.4210526316 '#ff5a00', > 66.7105263158 'orange-red', 78 'dark-red') > set output '/Applications/Heatmaps/htdocs/ftp/Heatmaps/heatMap_key30.jpg' > > set term jpeg size 600, 600 enhanced font '/Library/Fonts/arial.ttf' 8 > set dgrid3d 400,400 gauss 0.35,0.35 > set size square > set xtics("" 1, "Day 0" 2, "2-7\ndays" 3, "2\nWeeks" 4, "3\nWeeks" 5, > "1\nMonth" 6, "2-3\nMonths" 7, "4-6\nMonths" 8, "7-12\nMonths" 9, "1 > Year+" 10 ) > set title '{/=18 Chart Title}' offset 0, .5 > set ylabel '{/=16 Degree of Influence}' offset -1.6, 0 > set xlabel '{/=16 Days from Purchase}' offset 0,-1.6 > set xtics out nomirror > set ytics out nomirror > set ytics("" 0, "1" 1, "2" 2, "3" 3, "4" 4, "5" 5, "6" 6, "7" 7, "8" 8, > "9" 9, "10" 10, "" 11) > set y2tics("" 0, "1" 1, "2" 2, "3" 3, "4" 4, "5" 5, "6" 6, "7" 7, "8" 8, > "9" 9, "10" 10, "" 11) > set xrange [0:11] reverse > set yrange [0:11] > splot [1:] '/Applications/Heatmaps/htdocs/ftp/Heatmaps/dataFileKey_30' > matrix > > replot > ------------------------------------------------------------------------------ > 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 > > -- View this message in context: http://old.nabble.com/Histogram-Bar-Plot-Troubles-tp30208070p30215322.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Vik R. <vi...@mi...> - 2010-11-15 03:36:26
|
I just sent it to the list. Sorry if it got attached to the thread for your post. I will resend. Best, -Vik On Nov 14, 2010, at 6:59 PM, arnold4life wrote: > > How does this relate to my original post...? > > > Vik_R wrote: >> >> When I run a sample contour chart in Excel and in DeltaGraph, I get a >> different look than I do with the false color map in gnuplot. The Excel >> and DeltaGraph charts have very straight, angled edges, which my client >> prefers. The gnuplot chart is in squarish blocks. Is it possible to avoid >> this squarish blocky look, and to get this look that we find in Excel and >> Deltagraph charts, with a gnuplot false color or contour chart? >> >> Link to Excel sample chart: >> http://www.market-research-services.com/Temporary/Excel-sample.jpg >> >> Link to DeltaGraph sample chart: >> http://www.market-research-services.com/Temporary/DeltaGraph-sample.jpg >> >> Link to Gnuplot sample chart: >> http://www.market-research-services.com/Temporary/gnuplot-sample.jpg >> >> Link to datafile: >> http://www.market-research-services.com/Temporary/dataFileKey_30 >> >> Thanks very much in advance for any info. >> >> Best, >> >> >> -Vik >> >> >> >> >> gnuplot commands: >> unset surface >> unset key >> set view map >> set pm3d >> set palette defined (0 'black', 2 'gray50', 3 'dark-blue', 8.43243243243 >> 'dark-green', 18.972972973 'light-green', 20.5263157895 '#dac000', >> 30.7894736842 '#fee000', 32.8421052632 '#ff8000', 55.4210526316 '#ff5a00', >> 66.7105263158 'orange-red', 78 'dark-red') >> set output '/Applications/Heatmaps/htdocs/ftp/Heatmaps/heatMap_key30.jpg' >> >> set term jpeg size 600, 600 enhanced font '/Library/Fonts/arial.ttf' 8 >> set dgrid3d 400,400 gauss 0.35,0.35 >> set size square >> set xtics("" 1, "Day 0" 2, "2-7\ndays" 3, "2\nWeeks" 4, "3\nWeeks" 5, >> "1\nMonth" 6, "2-3\nMonths" 7, "4-6\nMonths" 8, "7-12\nMonths" 9, "1 >> Year+" 10 ) >> set title '{/=18 Chart Title}' offset 0, .5 >> set ylabel '{/=16 Degree of Influence}' offset -1.6, 0 >> set xlabel '{/=16 Days from Purchase}' offset 0,-1.6 >> set xtics out nomirror >> set ytics out nomirror >> set ytics("" 0, "1" 1, "2" 2, "3" 3, "4" 4, "5" 5, "6" 6, "7" 7, "8" 8, >> "9" 9, "10" 10, "" 11) >> set y2tics("" 0, "1" 1, "2" 2, "3" 3, "4" 4, "5" 5, "6" 6, "7" 7, "8" 8, >> "9" 9, "10" 10, "" 11) >> set xrange [0:11] reverse >> set yrange [0:11] >> splot [1:] '/Applications/Heatmaps/htdocs/ftp/Heatmaps/dataFileKey_30' >> matrix >> >> replot >> ------------------------------------------------------------------------------ >> 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 >> >> > > -- > View this message in context: http://old.nabble.com/Histogram-Bar-Plot-Troubles-tp30208070p30215322.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 |
|
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 > |
|
From: arnold4life <chr...@ho...> - 2010-11-14 17:16:35
|
Thanks, I've seen those scripts, but I want the x-axis scaled into bins. That way I have one bar for grades that are 70-79%, 80%-89%, etc. Mauricio Galo wrote: > > 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 >> > > > > ------------------------------------------------------------------------------ > 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 > > -- View this message in context: http://old.nabble.com/Histogram-Bar-Plot-Troubles-tp30208070p30213136.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |