SHRram
SHRram

Reputation: 4227

Plot tick level control

Here is my question:

myd <- data.frame (V1 = paste ("V", 1:1000), V2 = rnorm(1000))

plot(myd[,1], myd[,2])

enter image description here

As my plot is busy in axis, I want to just put tick markers at every 100 and display corresponding labels. Also tick only (without label) is displayed at between two hundred ticks. For example, ticks and labels at 1, 100, 200, 300.....1000, ticks only at 50, 150, 250, 350 ......950

How I can I achieve this ?

Edit:

Example :

|   |    |    |    |     |    |
V1       V100      V200      V300    

Upvotes: 1

Views: 4110

Answers (1)

johannes
johannes

Reputation: 14453

You could use:

plot(myd[,1], myd[,2], xaxt="n")
axis(1, at=seq(0,1000,50))

also have a look at ?axis for details about ticks and labels.

Updated answer

axis(1, at=seq(0,1000,100), label=paste0("V", seq(0, 1000, 100)))
axis(1, at=seq(50,1000,100), label=F, tick=T)

Upvotes: 4

Related Questions