How to create a plot in base R with tick marks of larger size?

R ProgrammingServer Side ProgrammingProgramming

Artificial Intelligence : The Future Of Programming

15 Lectures 54 mins

Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

C Programming from scratch- Master C Programming

Best Seller

60 Lectures 8 hours

To create a plot in base R with tick marks of larger size, we can make use of axis function tck argument. The tck argument value will decide the size of the tick mark but since the ticks lie below the plot area hence the value will have a negative associated with it. Therefore, it will be like -0.05. Check out the below examples to understand how it works.

Example

plot(1:10,axes=FALSE,frame=TRUE)
axis(1,1:10,tck=-0.02)
axis(2,1:10,tck=-0.02)

Example

plot(1:10,axes=FALSE,frame=TRUE)
axis(1,1:10,tck=-0.05)
axis(2,1:10,tck=-0.05)

Output

Updated on 08-Feb-2021 05:08:48