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,250 points

edited May 29, 2018 by DataKing99 718 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,660 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,790 points
1,030 views
0 votes
1 answer

Export the plot to a pdf or png - R

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

answered Jul 15, 2019 in Data Analytics by anonymous
2,638 views
0 votes
1 answer

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

Add a limit to axis ticks using ...READ MORE

answered Nov 3, 2019 in Data Analytics by anonymous
• 33,030 points
672 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,720 points

edited Jun 9, 2020 by MD 8,748 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,660 points

edited Jun 9, 2020 by MD 3,647 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,660 points
24,754 views
0 votes
1 answer
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,660 points
9,660 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 29, 2018 in Data Analytics by Bharani
• 4,660 points
3,789 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP