Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!m18g2000vbl.googlegroups.com!not-for-mail From: Felix Roth Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Histograms: bar width differs Date: Sat, 2 Jul 2011 05:38:12 -0700 (PDT) Organization: http://groups.google.com Lines: 105 Message-ID: <0e820995-dcf8-4a83-bca4-e7f29e58131b@m18g2000vbl.googlegroups.com> References: NNTP-Posting-Host: 93.192.43.142 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1309612021 13368 127.0.0.1 (2 Jul 2011 13:07:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 2 Jul 2011 13:07:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m18g2000vbl.googlegroups.com; posting-host=93.192.43.142; posting-account=a_hbzAoAAACkfGmo0Yh3ZDdGU80w9DxV User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20100101 Firefox/4.0,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:417 On 2 Jul., 11:56, Felix Roth wrote: > Dear all, > > I am currently writing my master thesis and use gnuplot to visualize > the generated data. So far it has been working fine, but the bar width > in my histograms differs. I call gnuplot from a java program, the > command list looks like this: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set terminal png font > 'Times-Roman, 9' \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set key right top \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set datafile separator ','\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 String co= mmand =3D "set output 'D:\\\\Dokumente\\\\My Dropbox\\\\Uni\ > \\\Semester =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 4\\\\CSV\\\\" + graphName +"'= \n"; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= (command); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set xtics 1\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set ytics 10\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set xlabel 'rounds'\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set ylabel 'values'\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set yrange [0:120]\n"); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style line 1 lt 1 lw 1 lc rgb 'red' \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style line 2 lt 1 lw 1 lc rgb 'forest-green' \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style line 3 lt 1 lw 1 lc rgb 'royalblue' \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style line 4 lt 1 lw 1 lc rgb 'purple' =A0\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style line 5 lt 1 lw 1 lc rgb 'gold' \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style line 6 lt 1 lw 1 lc rgb 'orange' \n"); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style data histograms \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style histogram clustered gap 2 \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set style fill solid border -1 \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("set boxwidth -2 \n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 command = =3D "plot " + modifiedCSVFile + " using 2 ls 1 title > columnheader(2)," + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modifiedC= SVFile + " using 3 ls 2 title columnheader(3)," + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modifiedC= SVFile + " using 4 ls 3 title columnheader(4)," + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modifiedC= SVFile + " using 5 ls 4 title columnheader(5)," + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modifiedC= SVFile + " using 6 ls 5 title columnheader(6)," + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modifiedC= SVFile + " using 7 ls 6 title columnheader(7)\n"; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= (command); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.write= ("quit\n"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.flush= (); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 out.close= (); > > Out is a buffer used to communicate with gnuplot and I have to add \n > to each command to finish each input. The resulting plot looks like > this:http://tinypic.com/r/wivlw5/7 > My data file is a .csv file with following entries: > round,interactions,crossing interactions,execution time > (ms),communication cost,reassignments,overloaded peers > 1,5,30,194,40,0,0 > 2,5,30,112,40,0,0 > 3,5,30,105,40,0,0 > 4,5,30,88,40,13,0 > 5,5,30,100,40,12,0 > 6,4,31,85,40,12,0 > 7,4,31,71,40,11,0 > 8,4,31,119,40,14,0 > 9,4,31,281,40,0,0 > 10,4,31,182,40,0,0 > 11,4,31,231,40,12,0 > 12,4,31,241,40,0,0 > 13,4,31,237,40,0,0 > 14,4,31,199,40,0,0 > 15,4,31,330,40,14,0 > > Any suggestions how to fix this problem? I am completely stumped. > > Thanks in advance! Update: I have replaced set xticks with set autox and strangely this seems to help.