Reputation: 5789
When I do a plot function in R i get marks on the axes, for examples:
set.seed(123)
plot(matrix(rnorm(100),50,2))
puts marks at (y axis) of {-2,-1,0,1,2}.
My question is:
How can I get these values returned as a vector? Something like:
> GetTickMarkValues()
[1] -2 -1 0 1 2
Upvotes: 2
Views: 378
Reputation: 15441
This gives you the extreme values for tick marks and the number of intervals between them:
x <- 1:5
y <- 1:5
plot(x,y)
par("xaxp")
[1] 1 5 4
Upvotes: 3