Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (7.3k points)

I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.

I know that axes = false will get rid of the entire axis, but I would only like to get rid of the numbering.

1 Answer

0 votes
by

To remove x and y-axis values use xaxt="n" and yaxt="n"  that suppress the x and y-axis respectively.

For example:

For the plot below:

        

data(mtcars)

plot(x= mtcars$mpg,y=mtcars$cyl)

image

To remove x and y-axis values:

plot(x= mtcars$mpg,y=mtcars$cyl, xaxt='n')

plot(x= mtcars$mpg,y=mtcars$cyl, yaxt='n')

Outputs:

image
image

Related questions

0 votes
1 answer
+1 vote
3 answers
asked Jul 10, 2019 in R Programming by Ajinkya757 (5.3k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...