Dear R-users, I'm tackling with a problem which causing me a head-ache for a long time. I would like to create a nice x-axis to my plots, but I do not know how to implement the method.
Imagine a matrix where you have rownames real numbers -- these rownames should be written in the x-axis nicely. I could not find any way how. I'll describe what I'm doing now: I have a matrix where each column is an independent curve (number of the columns 3-4). The rownames are the x-axis, and the names are real numbers (converted to chars, of course). I find the max and the min among the values in the matrix (for the y-axis) and I'm creating an empty plot. x-axis is c(0, nrow(matrix)). Now, I'm creating the x-axis labels Labels <- seq(1, nrow(matrix), by = 100) axis(1, at = NULL, labels = rownames(matrix)[Labels]) At this point I'd like to have instead of "24.12333 26.45667 28.79 31.12333 33.45667" at the x-axis, an optimally placed ticks at let's say "26 28 30 32" -- this is what I cannot achieve. Afterwards I'm plotting the curves in different colours. I know that the x-values are accessed by the number of their row and not rowname. Anybody could point me into some direction, please? Thank you upfront! [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.