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


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

Re: Histograms: bar width differs

From Péter Juhász <peter.juhasz83@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Histograms: bar width differs
Date 2011-07-03 02:52 -0700
Organization http://groups.google.com
Message-ID <00d6c8d1-1c25-4a78-b20c-7c5b9d9ee650@d7g2000vbv.googlegroups.com> (permalink)
References <e5984c2c-d30f-4c18-8815-c7787ed3fc55@c41g2000yqm.googlegroups.com> <0e820995-dcf8-4a83-bca4-e7f29e58131b@m18g2000vbl.googlegroups.com> <iuncl0$6dn$1@dont-email.me>

Show all headers | View raw


On Jul 2, 5:14 pm, James Waldby <n...@valid.invalid> wrote:
> On Sat, 02 Jul 2011 05:38:12 -0700, Felix Roth wrote:
> > 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:
>
> [snip code]
>
> Because the problem apparently is not a consequence of how gnuplot was
> called, I suggest that instead of presenting the problem via java code
> you should present a text file of gnuplot commands that exhibit the
> problem.  The code you show is incomplete; other people cannot easily
> (if at all) replicate or diagnose your problem.
>
> >> 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
> [...]
> >> 15,4,31,330,40,14,0
>
> >> Any suggestions how to fix this problem? I am completely stumped.
>
> The problem may be due to quantization in the image file.  (Without
> running the plot it is hard to say for sure.)  The picture you
> posted is 640x480, quite small.   The round-3 bars are bounded by black
> lines at x-pixels 189, 193, 197, 202, 206, 210, using 21 pixels for 5
> bars.  If bars are 5.2 pixels wide, an extra pixel will get thrown in
> every so often.  

This is the case. In fact, some pixel-based terminals contain code to
ensure that histogram bars and other plot elements have widths and
heights of integer pixels.
This is one of the reasons why PNG images (especially at 640×480
resolution) are not appropriate in a master's thesis.

Use a vector-based terminal (postscript, pdf) instead.

Péter Juhász

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious 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