Making a ggplot2 plot without any legends,axes or axis labels

0 votes

I am making a bar-plot with ggplot2:\

ggplot(data=mtcars,aes(x=factor(cyl),fill=factor(cyl)))+geom_bar()

image

I would want to plot this without any axes or legends. How can i do it?

May 29, 2018 in Data Analytics by DataKing99
• 8,100 points

edited May 29, 2018 by DataKing99 37 views

1 answer to this question.

0 votes

The below command will give you the desired plot with no axes and legends:

ggplot(data=mtcars,aes(x=factor(cyl),fill=factor(cyl)))+geom_bar()+theme_void()+theme(legend.position="none")
image
answered May 29, 2018 by Bharani
• 4,550 points

Related Questions In Data Analytics

0 votes
1 answer

How can I add x and y axis labels in ggplot2 ?

# Load a dataset(to work with) # We’ll ...READ MORE

answered May 16, 2018 in Data Analytics by zombie
• 3,690 points
86 views
0 votes
1 answer

Export the plot to a pdf or png - R

You need to close the device to ...READ MORE

answered 3 days ago in Data Analytics by anonymous
7 views
0 votes
0 answers

How to edit the labels and limit if a plot using ggplot? - R

How to edit the labels and limit ...READ MORE

3 days ago in Data Analytics by piyush
5 views
0 votes
0 answers
0 votes
1 answer

How to plot side-by-side Plots with ggplot2 in R?

By Using gridExtra library we can easily ...READ MORE

answered Apr 16, 2018 in Data Analytics by DeepCoder786
• 1,700 points
1,170 views
0 votes
1 answer

Aligning title in ggplot2

You can use the theme layer to ...READ MORE

answered Apr 27, 2018 in Data Analytics by Bharani
• 4,550 points
594 views
0 votes
1 answer

Removing outliers from a box-plot - ggplot2 - R

You just have to add 'outlier.shape=NA' inside ...READ MORE

answered May 31, 2018 in Data Analytics by Bharani
• 4,550 points
2,028 views
0 votes
0 answers
0 votes
1 answer

Changing the order of bars in a bar-plot - ggplot2 - R

You can use the scale_x_discrete() function with ...READ MORE

answered May 28, 2018 in Data Analytics by Bharani
• 4,550 points
1,867 views
0 votes
1 answer

Showing percentage instead of counts in a bar plot - ggplot2 - R

Load the 'scales' package first, which gives ...READ MORE

answered May 28, 2018 in Data Analytics by Bharani
• 4,550 points
1,038 views