I would like to remove the tick marks from a plot in R, but not the text associated with the individual tick marks. How do I do that?
My code is the following:
boxplot(boxDat ~ class, ylab = "Predictive Scoring", names = c("ANN", "Random\nForest", "Logistic\nRegression"), cex.axis=1, xaxt='n')
Set xaxt = "n" and yaxt = "n" to remove the tick labels of the plot and add the new labels with the axis function.
By default, in the Matplotlib library, plots are plotted on a white background. Therefore, setting the color of tick labels as white can make the axis tick labels hidden.
The axes labels and ticks can be removed in ggplot using the theme() method. This method is basically used to modify the non-data components of the made plot. It gives the plot a good graphical customized look. The theme() method is used to work with the labels, ticks, and text of the plot made.
Maybe something like this:
boxplot(count ~ spray, data = InsectSprays, col = "lightgray",xaxt = "n")
axis(side = 1,at = 1:6,letters[1:6],tick = FALSE)
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