[R] (no subject)

Fino Fontana finofontana at yahoo.com
Sun Apr 15 02:11:36 CEST 2012


I am wrestling with the following in creating a barplot in R:
I have a data set with 18 entries. It is plotted in a bargraph. The x-axis should have 18 tick marks each with its own label. What happens is, only a few labels are shown; there is not enough space for all labels. The tick marks are concentrated on the left side of the axis.
I'd like to have all labels shown, in vertical direction.
This is part of the data:

> times
        taak  duur
1   algemeen 48.75
2   swimming 14.25
3   football 24.25
4     tennis 36.75
5  bicycling  1.50

Under 'taak' are the labels.
This is the code that should do the job:

barplot(
width= bar_width,
times$duur, 
names.arg=times$taak,
col=fill_colors,
border="NA",
space=0.3,
xlab="taak",
ylab="uren",
main="Uren per taak")

axis(1,at=1:length(times$taak),lab=times$taak)


Could anyone give me advise on how to get rid of this horrible x axis?

Thanks and r



More information about the R-help mailing list