[R] ploting labels on barplot

Jim Lemon jim at bitwrit.com.au
Sun Oct 28 11:29:00 CET 2007


Bernd Jagla wrote:
> Again me.
> 
>  
> 
> I want to plot the numbers on the bars of a barplot.
> 
> This can be done using hist function when setting the label argument true
> (i.e. 
> 
>  
> 
> data <- c(1,2,3,4)
> 
> hist(data,  labels=T) 
> 
>  
> 
> When I try this using barplot I get an error:
> 
>  
> 
> 
>>    barplot(summary(data), labels=T)
> 
> 
> Error in axis(if (horiz) 2 else 1, at = at.l, labels = names.arg, lty =
> axis.lty,  : 
> 
>         formal argument "labels" matched by multiple actual arguments
> 
> In addition: Warning message: 
> 
> parameter "labels" couldn't be set in high-level plot() function
> 
>  
Hi Bernd,
Try the "names.arg" argument in the "barp" function in plotrix.

Jim



More information about the R-help mailing list