0

Simple plots do not product the intended figures.

As an example I use the following code from a previous post:

library(ggplot2)
a <- seq(1,20)
b <- a^0.25
df <- data.frame(cbind(a,b))

ggplot(df, aes(x = a, y = b)) + geom_point() +
  theme_bw() +
  theme(axis.line = element_line(colour = "black"),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        panel.border = element_blank(),
        panel.background = element_blank()) 

This should produce: correct plot

but produces: false plot

How to find reasons for gglopt2 not producing the intended plots?

Version of ggplot:

> packageVersion("ggplot2")
[1] ‘2.1.0’

Version of R:

> version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          2.1                         
year           2015                        
month          06                          
day            18                          
svn rev        68531                       
language       R                           
version.string R version 3.2.1 (2015-06-18)
nickname       World-Famous Astronaut 
Community
  • 1
  • 1
eliascis
  • 317
  • 2
  • 10
  • 1
    For some reason, the generalized forms in `theme` (in this case, `axis.line`) don't seem to be getting inherited by the specific ones. If you specify both the x and the y `axis.line.x = element_line(colour = "black"), axis.line.y = element_line(colour = "black"),` it works fine. I'm really not sure what the issue is, but I've seen it before with other inheritance in `theme`. – alistaire May 27 '16 at 15:57
  • You are using the latest `ggplot2` but still sticking with R 3.2.1 while R 3.3.0 has come out. I would upgrade my R before digging into the specific issue. – Psidom May 27 '16 at 15:59
  • @alistaire: replacing the axis.line option with the single options for axis.line.x and axis.line.y work very well. Thanks a lot! – eliascis May 27 '16 at 16:47

0 Answers0