Hi,

Hoping someone can help with what may seem like a simple question. I would like to use ggplot2 to plot a graph with a black border but a custom fill.

Using the following code I have managed to puoulate the graph as I would like it:

    # creating color palette
    >cols <- c("red" = "red", "orange" = "orange", "nonsignificant" = "darkgrey", "Increased" = "#00B2FF", "Decreased" = "#00B2FF")
    
    # Make a basic ggplot2 object
    >vol <- ggplot(data, aes(x = lfc, y = pval, color = color, labels=gene))
    
    # inserting mnaual colors as per color pallette and more
    >vol +   
      scale_colour_manual(values = cols) +
      ggtitle(label = "Volcano Plot", subtitle = "Colored by fold-change direction") +
      geom_point(size = 2.5, alpha = 1, na.rm = T) +
      theme_bw(base_size = 14) + 
      theme(legend.position = "right") + 
      xlab(expression(log[2]("VitD" / "Carrier"))) + 
      ylab(expression(-log[10]("FDR"))) +
      geom_hline(yintercept = 1, colour="#990000", linetype="dashed") + geom_vline(xintercept = 0.586, colour="#990000", linetype="dashed") + geom_vline(xintercept = -0.586, colour="#990000", linetype="dashed") +
      scale_y_continuous(trans = "log1p") 

Gives me the plot:

![enter image description here][1]

I understand that I need to define points as shape 21 before defining both color and fill t get different colors for border and fill. So I tried adding ,shape = 21, colour = "black" into my geom_point() agreement, but this turns everything black

    >  vol +   
      ggtitle(label = "Volcano Plot", subtitle = "Colored by fold-change direction") +
      geom_point(size = 2.5, alpha = 1, na.rm = T, shape = 21, colour = "black") +
      scale_colour_manual(values = cols) +
      theme_bw(base_size = 14) + 
      theme(legend.position = "right") + 
      xlab(expression(log[2]("VitD" / "Carrier"))) + 
      ylab(expression(-log[10]("FDR"))) + 
      geom_hline(yintercept = 1, colour="#990000", linetype="dashed") + geom_vline(xintercept = 0.586, colour="#990000", linetype="dashed") + geom_vline(xintercept = -0.586, colour="#990000", linetype="dashed") +
      scale_y_continuous(trans = "log1p") 

![enter image description here][2]

THANKS!!

  [1]: https://i.imgur.com/14wKc8S.png
  [2]: https://i.imgur.com/xW5STjv.png
Hi,

I assume (haven't tested it on your data), that you should merely replace *color = color* with *fill = color* in your assignment of **vol**



