I want to remove labels and axis from X axis, however adding new ticks.
plot(1:10, ylab = "") at1 <- seq(1, 10, 0.1) axis(side = 1, at = at1, labels = FALSE)
I could not get rid of y labels.
Option 1. Set xaxt = "n" and yaxt = "n" to remove the tick labels of the plot and add the new labels with the axis function. Note that the at argument sets where to show the tick marks.
If you are going to create a custom axis, you should suppress the axis automatically generated by your high level plotting function. The option axes=FALSE suppresses both x and y axes. xaxt="n" and yaxt="n" suppress the x and y axis respectively.
Data Visualization using R Programming When we create a plot in R, the Y-axis labels are automatically generated and if we want to remove those labels, the plot function can help us. For this purpose, we need to set ylab argument of plot function to blank as ylab="" and yaxt="n" to remove the axis title.
xticks([]) method to invisible both the ticks and labels on the x-axis and set the ticks empty. plt. yticks() method to invisible both the ticks and labels on the y-axis and set the ticks empty. In last, we use the show() method to display the graph.
see ?par
You need the xaxt
argument
plot(1:10, ylab = "", xaxt='n')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With