Numeric point characters in r do not fully show

60 views Asked by At

enter image description here

Above is an image of a simple plot I have created with x,y co-ordinates. I have passed pch = as.character(1:32) into the plot, but after the first 9 characters, it will cut off the second character. How do you fix this? I guess I need to increase the width of each point?

Thanks!

1

There are 1 answers

0
Quinten On

You could use text with argument label like this:

df <- data.frame(x = c(rep(1:5, each = 5)),
                 y = c(rep(1:5, 5)))

plot(df$x, df$y, type='n')
text(df$x, df$y, label = 1:25)

Created on 2022-08-21 with reprex v2.0.2