Answers.Body: <p>wish there was a more subtle answer, but this works.  Place this previous to your VlnPlot</p>
  <pre class="lang-r prettyprint-override"><code>update_geom_defaults(&quot;violin&quot;, aes(linewidth = 0))
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-11T18:56:17.427Z
Answers.LastActivityDate: 2023-04-11T19:25:29.093Z
Answers.LastEditDate: 2023-04-11T19:25:29.093Z
Answers.UserDisplayName: Nathan Siemers
Answers.Body: <pre class="lang-r prettyprint-override"><code>vln_df = data.frame(gene = ilc2_bs[[&quot;RNA&quot;]]@data[ &quot;gene&quot;, ],
                      group = ilc2$group)
  
  ggplot(vln_df, aes(x = group, 
                     y = gene, fill = group)) + 
    geom_violin(aes(fill = group, 
                    color = gene),
                color = NA) +
    scale_fill_manual(values = c(&quot;#619CFF&quot;, &quot;#F8766D&quot;)) +
    geom_boxplot(aes(fill = group),
                 width = 0.1) + theme(aspect.ratio = 1)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-19T21:50:19.270Z
Answers.LastActivityDate: 2023-04-11T19:26:17.940Z
Answers.LastEditDate: 2023-04-11T19:26:17.940Z
Answers.UserDisplayName: Charles
Body: <p>Using Seurat's VlnPlot, how can I remove the black outline around the violin plot?</p>
  <p>For example, how can I change from the following graph with a (black) outline:</p>
  <pre class="lang-r prettyprint-override"><code>    VlnPlot(ilc2,
          features = &quot;gene&quot;,
          split.by = &quot;group&quot;, 
          cols = c(&quot;#198BFD&quot;, &quot;#EC6464&quot;),
          pt.size = 0) +
    geom_boxplot(width = 0.1) + theme(aspect.ratio = 1)
  </code></pre>
  <p><a href="https://i.sstatic.net/wBszy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wBszy.png" alt="enter image description here" /></a></p>
  <p>To a graph like the one below, which does not have an outline around the violin plot:</p>
  <p><a href="https://i.sstatic.net/va4ps.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/va4ps.png" alt="enter image description here" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-09-08T22:58:52.573Z
Comments.Text: Please consider "accepting" your answer and upvoting the other helpful answer here.
Comments.UserDisplayName: M__
Tags: <seurat><ggplot2>
Title: How to remove black outline from Seurat's VlnPlot violin plot
ThreadText: # How to remove black outline from Seurat's VlnPlot violin plot
  
  (Asked by: username_0 on 2022-08-26)
  
  Using Seurat's VlnPlot, how can I remove the black outline around the violin plot?
  
  For example, how can I change from the following graph with a (black) outline:
  
  ```r
      VlnPlot(ilc2,
          features = "gene",
          split.by = "group", 
          cols = c("#198BFD", "#EC6464"),
          pt.size = 0) +
    geom_boxplot(width = 0.1) + theme(aspect.ratio = 1)
  
  ```
  
  [![enter image description here](https://i.sstatic.net/wBszy.png)](https://i.sstatic.net/wBszy.png)
  
  To a graph like the one below, which does not have an outline around the violin plot:
  
  [![enter image description here](https://i.sstatic.net/va4ps.png)](https://i.sstatic.net/va4ps.png)
  
  **Tags:** seurat, ggplot2
  
  > **Comments:**
  > **username_1**: Please consider "accepting" your answer and upvoting the other helpful answer here.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2023-04-11. Score: 2
  
  wish there was a more subtle answer, but this works. Place this previous to your VlnPlot
  
  ```r
  update_geom_defaults("violin", aes(linewidth = 0))
  
  ```
  
  
  ---
  
  ### Answer by username_0 on 2022-09-19. Score: 1
  
  ```r
  vln_df = data.frame(gene = ilc2_bs[["RNA"]]@data[ "gene", ],
                      group = ilc2$group)
  
  ggplot(vln_df, aes(x = group, 
                     y = gene, fill = group)) + 
    geom_violin(aes(fill = group, 
                    color = gene),
                color = NA) +
    scale_fill_manual(values = c("#619CFF", "#F8766D")) +
    geom_boxplot(aes(fill = group),
                 width = 0.1) + theme(aspect.ratio = 1)
  
  ```
  
  
  ---
  
  