[R] Barplot axis titles
jim at bitwrit.com.au
Thu Feb 11 06:49:08 CET 2010
On 02/11/2010 01:03 PM, RagingJim wrote:
> Now, I think I am making this harder than it seems, but...
> I am writing a script that will allow me to pull any csv file with annual
> rainfall and plot it into a bar plot. The problem I am facing is that the
> different sites have recorded data for a different number of years. This
> means that every csv file has a different number of values.
> I need to somehow get a label at every 10 or 20 year points, and it has be
> able to allow for the fact that some files have 50 readings, and others have
> 200 readings.
> Now, if I use this:
> I can get it for one file, but as soon as a file has a diff number of
> values, it does not work.
> The best I have been able to come up with is this:
> barplot(Ann,main=title, xlab="Year",ylab="Rainfall
> however I cannot control how often the labels occur. I am sure there is an
> easy way to do this, but I cannot find it. I assume it will have something
> to do with names.arg, but I am not sure how to write what i want to write.
How about this?
barplot(Ann,main=title, xlab="Year",ylab="Rainfall (mm)",
More information about the R-help