help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bar and hist


From: Kai Habel
Subject: Re: bar and hist
Date: Thu, 01 Nov 2007 12:02:49 +0100

-------- Original-Nachricht --------
> Datum: Thu, 1 Nov 2007 18:54:31 +0800
> Von: Evan <address@hidden>
> An: kahacjde <address@hidden>
> CC: address@hidden
> Betreff: Re: bar and hist

> On 11/1/07, kahacjde <address@hidden> wrote:
> >
> > In that case you can do:
> >
> > [n,x] = hist(randn(1000,1));
> > bar(x,n,'FaceColor','magenta')
> >
> > or
> >
> > hist(randn(1000,1));
> > p = findobj(gca,'Type','patch');
> > set(p,'FaceColor','magenta');
> >
> > but in the 2nd example the properties of *all* patches of the current
> axes
> > object are being changed. So, I would recommend the 1st method.
> >
> >
> > Kai
> >
> 
> I tried this, the problem is that bar doesn't plot bars side by side
> as hist does, there is space between bars, I find no document on how
> to suppress the space between bars.

Then the first method should work. Or,

bar(x,n,1.0,'FaceColor','b');

where the 3rd argument is the relative width of each bar. It seems the help 
string of bar is not up to date. 

Kai


reply via email to

[Prev in Thread] Current Thread [Next in Thread]