[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #35740] bar() does not accept width argument
From: |
Ismael Núñez-Riboni |
Subject: |
Re: [bug #35740] bar() does not accept width argument |
Date: |
Thu, 08 Mar 2012 09:49:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
On 03/08/2012 07:54 AM, Rik wrote:
Update of bug #35740 (project octave):
Status: None => Works For Me
Release: dev => 3.4.3
_______________________________________________________
Follow-up Comment #1:
Setting the width works fine for me with 3.4.3 or with a development branch.
Plotting works perfectly well with either gnuplot or fltk.
There might be conflicts with packages you have installed. You could try
running 'octave -f' to start without reading any initialization files. Once
in Octave, try 'pkg unload all' to unload any packages. After that, try
plotting with bar again to see if it works.
The code I used is
bar (1:5, 1:5);
figure;
bar (1:5, 1:5, 0.5);
This also works for me under both gnuplot and fltk, and with all my
packages loaded...
What I called bug#1 is not a bug, I was misunderstanding the
functionality of "bar", I though that it was like "hist", i.e., that it
bins the Y data in classes of X. This is not the case, bar simply plots
the (X,Y) data like the function plot, but with bars. If you have a
large data density in X you cannot demand from the parameter W a width
larger than the separation between the bars. Sorry, my mistake. I don't
know if other users could get confused, I think a sentence like this in
"help bar" could be helpful: "note this function does not averages Y in
bins of X" or something similar.
What I called bug #2 is, however, still there. It does not seem related
to memory, as it was my first guess. I know this sounds also not
logical, but it simply seems related to the vector x not being equally
spaced. Try this with the data I uploaded:
-------------------------
graphics_toolkit fltk
load('temp')
figure
bar(x,y)
# You get no plot, unless I need new glasses... Now try:
x = [min(x):(max(x)-min(x))./(length(x)-1):max(x)]'; # It homogenizes
the separations between x points (they are equidistant now)
figure
bar(x,y) # You get a plot now...
-------------------------
It is also not x or y having NaNs (which also came to mind), since:
r = 1e-1; x = [1:r:5];, x(end) = NaN; figure, bar (x,x)
produces a plot...
Cheers, Ismael.
PS: Shortly before I sent the e-mail I also tried:
r = 1e-1; x = [1:r:5];, figure, bar (log(x),x)
which renders the separation between x points non-equidistant and
however you get a plot... I take it back, so I don't know where the
problem is coming from but it really looks like a bug to me...
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [bug #35740] bar() does not accept width argument,
Ismael Núñez-Riboni <=