Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to create a boxplot using ggplot2 for single variable without X-axis labels in R?
The important part of a boxplot is Y−axis because it helps to understand the variability in the data and hence, we can remove X−axis labels if we know the data description. To create a boxplot using ggplot2 for single variable without X−axis labels, we can use theme function and set the X−axis labels to blank as shown in the below example.
Example
ggplot(df,aes(x=factor(0),y))+geom_boxplot()+theme(axis.title.x=element_blank(),axis.text.x=element_blank(),axis.ticks.x=element_blank())
Output

Advertisements
