help-octave
[Top][All Lists]
Advanced

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

Re: bar and hist


From: kahacjde
Subject: Re: bar and hist
Date: Thu, 1 Nov 2007 03:07:05 -0700 (PDT)



Evan-4 wrote:
> 
> On 10/31/07, kahacjde <address@hidden> wrote:
>>
>> Hello,
>>
>> bar and hist are using 'patch' graphic objects now. You have to change
>> the
>> patch properties like this:
>>
>> h = bar(rand(10,1));
>> set(h,'FaceColor','yellow','EdgeColor',[0.2 0.7 0.4]);
>>
>> or in one line
>>
>> bar(rand(10,1), 'FaceColor', 'yellow', 'EdgeColor', [0.2 0.7 0.4]);
>>
>> Kai
> 
> It seems that this doesn't work for hist
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
> 
> 

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
-- 
View this message in context: 
http://www.nabble.com/bar-and-hist-tf4725661.html#a13525941
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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