Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #417

Re: Histograms: bar width differs

From Felix Roth <felix.gerhard.roth@googlemail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Histograms: bar width differs
Date 2011-07-02 05:38 -0700
Organization http://groups.google.com
Message-ID <0e820995-dcf8-4a83-bca4-e7f29e58131b@m18g2000vbl.googlegroups.com> (permalink)
References <e5984c2c-d30f-4c18-8815-c7787ed3fc55@c41g2000yqm.googlegroups.com>

Show all headers | View raw


On 2 Jul., 11:56, Felix Roth <felix.gerhard.r...@googlemail.com>
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:
>
>                                 out.write("set terminal png font
> 'Times-Roman, 9' \n");
>                                 out.write("set key right top \n");
>                                 out.write("set datafile separator ','\n");
>                                 String command = "set output 'D:\\\\Dokumente\\\\My Dropbox\\\\Uni\
> \\\Semester                 4\\\\CSV\\\\" + graphName +"'\n";
>                                 out.write(command);
>                                 out.write("set xtics 1\n");
>                                 out.write("set ytics 10\n");
>                                 out.write("set xlabel 'rounds'\n");
>                                 out.write("set ylabel 'values'\n");
>                                 out.write("set yrange [0:120]\n");
>
>                                 out.write("set style line 1 lt 1 lw 1 lc rgb 'red' \n");
>                                 out.write("set style line 2 lt 1 lw 1 lc rgb 'forest-green' \n");
>                                 out.write("set style line 3 lt 1 lw 1 lc rgb 'royalblue' \n");
>                                 out.write("set style line 4 lt 1 lw 1 lc rgb 'purple'  \n");
>                                 out.write("set style line 5 lt 1 lw 1 lc rgb 'gold' \n");
>                                 out.write("set style line 6 lt 1 lw 1 lc rgb 'orange' \n");
>
>                                 out.write("set style data histograms \n");
>                                 out.write("set style histogram clustered gap 2 \n");
>                                 out.write("set style fill solid border -1 \n");
>                                 out.write("set boxwidth -2 \n");
>                                 command = "plot " + modifiedCSVFile + " using 2 ls 1 title
> columnheader(2)," +
>                                 modifiedCSVFile + " using 3 ls 2 title columnheader(3)," +
>                                 modifiedCSVFile + " using 4 ls 3 title columnheader(4)," +
>                                 modifiedCSVFile + " using 5 ls 4 title columnheader(5)," +
>                                 modifiedCSVFile + " using 6 ls 5 title columnheader(6)," +
>                                 modifiedCSVFile + " using 7 ls 6 title columnheader(7)\n";
>
>                                 out.write(command);
>                                 out.write("quit\n");
>                                 out.flush();
>                                 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.

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Histograms: bar width differs Felix Roth <felix.gerhard.roth@googlemail.com> - 2011-07-02 02:56 -0700
  Re: Histograms: bar width differs Felix Roth <felix.gerhard.roth@googlemail.com> - 2011-07-02 05:38 -0700
    Re: Histograms: bar width differs James Waldby <not@valid.invalid> - 2011-07-02 15:14 +0000
      Re: Histograms: bar width differs Péter Juhász <peter.juhasz83@gmail.com> - 2011-07-03 02:52 -0700

csiph-web