[R] barplot with a probability density curve

Olga Lyashevska olga at herenstraat.nl
Mon Mar 15 11:44:27 CET 2010


Dear All,

Thanks everyone for your kind responses.
Now I understand what is gong on!  I guess that the question asked is  
wrong in the first place.
As there is a categorical list of groups and their values (a range of  
pipe diameters and a flow for each diameter), and a barplot would be a  
suitable tool to use.
However, it also means that I cannot plot probability density curve  
using this type of data because I would need to have a histogram  
instead. Did I get it right?

Many thanks,
Olga



> On 03/15/2010 08:32 AM, Olga Lyashevska wrote:
>> Dear all,
>>
>> I am making a barplot as following:
>>
>> barplot 
>> (c 
>> (1,2,3,5,2,3,1 
>> ),names 
>> .arg 
>> = 
>> c 
>> ("100 
>> ","200 
>> ","300 
>> ","400","500","600","700"),xlab="diameter",ylab="flow",main="some  
>> title",space=0.1)
>>
>> I am also trying to add a probability density curve, however using
>> lines(density(c(1,2,3,5,2,3,1))) does not give a desired result.



More information about the R-help mailing list