user189035
user189035

Reputation: 5789

R plot axes tick labels

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

Answers (1)

user1317221_G
user1317221_G

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

Related Questions