user692704
user692704

Reputation: 554

How to remove the axis marks in R ggplot

I have a plot don with ggplot. I don't need the axis value, which I successfully removed using axis.text.x = element_blank() and axis.text.y = element_blank(). However, I have been left wight the axis marks "the small lines at the end of each value in the x and y lines" I have pot them in small red circles for clarifications. I wounded if anyone have an idea of how to get red of those as well.

Here is my code:

library(ggplot2)
library(plyr)
weights1    <-read.csv ("./EN_ALPHA_WHIGHTS.csv")
ca          <- ddply(weights1, "comb", transform,  percent_weight = pers / sum(pers) *  100)
ggplot(ca, aes(x=comb, y=percent_weight, fill=alpha))+geom_bar(stat="identity")+xlab("")+ylab("")+theme(legend.position="none",axis.text.x = element_blank(),axis.text.y = element_blank())+theme(legend.title=element_blank(),legend.text = element_text(colour = 'gray', angle = 45, size = 3, hjust = 3, vjust = 3))

Many thanks

enter image description here

Upvotes: 1

Views: 1507

Answers (1)

Karan
Karan

Reputation: 284

Have you tried this?

axis.ticks = element_blank()

Upvotes: 5

Related Questions