Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Theme elements axis.line.x and axis.line.y do not work #778

izahn opened this Issue · 2 comments

3 participants


axis.line.x and axis.line.y do not set the theme for the x axis line and y axis line as expected.

Minimal reproducible example:

p <- ggplot() + geom_blank(aes(x=1:10, y=1:10))
p + theme(panel.border=element_blank(), axis.line=element_line()) ## works
p + theme(panel.border=element_blank(), axis.line.x=element_line()) ## does not work
p + theme(panel.border=element_blank(), axis.line.y=element_line()) ## does not work

It is possible to set just one or the other by setting axis.line then turning one "off":

p + theme(panel.border=element_blank(), axis.line=element_line(), axis.line.y=element_blank()) ## works

But I don't think this is how it's supposed to work.

> sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ascii_2.1       ggplot2_0.9.3.1 reshape2_1.2.2  plyr_1.8       
[5] foreign_0.8-52 

loaded via a namespace (and not attached):
 [1] MASS_7.3-23        RColorBrewer_1.0-5 colorspace_1.2-1   compiler_2.15.3   
 [5] dichromat_2.0-0    digest_0.6.3       grid_2.15.3        gtable_0.1.2      
 [9] labeling_0.1       munsell_0.4        proto_0.3-10       scales_0.2.3      
[13] stringr_0.6.2      tools_2.15.3      

This sounds like a great feature, but unfortunately we don't currently have the development bandwidth to support it. If you'd like to submit a pull request that implements this feature, please follow the instructions in the development vignette.

@hadley hadley closed this

Thanks for this post and work-around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.