<p>Try using <code>SplitDotPlotGG</code>, this will allow you to color the dots by some additional variable (eg condition).</p>

<p>In your case you would want to do something like this:</p>

<pre><code>library(Seurat)

SplitDotPlotGG(object = object,
               genes.plot = c("Gene1", "Gene2"),
               plot.legend = TRUE,
               group.by = "cell_types",
               grouping.var = "tissue_types")
</code></pre>

<p>This would give a result similar to below (an example from <a href="https://satijalab.org/seurat/immune_alignment.html" rel="nofollow noreferrer">https://satijalab.org/seurat/immune_alignment.html</a>).</p>

<p><a href="https://i.sstatic.net/Ynq5g.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ynq5g.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2019-01-15T09:50:13.520Z
Thank you very much, it works. However the plot does not appear (plotting space on Rstudio remains blank) when I set plot.legend = TRUE, but the plot does appear without a legend  when I set plot.legend = FALSE. How can I proceed to fix this? **@TimStuart**
Charles
CC BY-SA 4.0
2019-01-15T14:23:08.653Z
You probably need to make the plotting device bigger
TimStuart
CC BY-SA 4.0
2019-01-14T22:10:05.453Z
2019-01-14T22:10:05.453Z
TimStuart
<p>I am new to single cell sequencing data analysis but I have basic programming background in R and python. I want to be able to plot differential expression of two genes, Gene1 and Gene2, across three cell types and across three conditions on one plot. I have followed this <a href="https://satijalab.org/seurat/pbmc3k_tutorial.html" rel="nofollow noreferrer">tutorial</a> to perform QC and various differential analyses using Seurat package on my data up till now. </p>

<p>My data set is one object, containing information about the three cell types under three various conditions. The metadata slot of my data set contains information about my cell types as well as the conditions under which they are tested. Using the following DotPlot commands I am able to generate separate plots of gene expression with respect to cell type and with respect to condition:</p>

<pre><code>Seurat::DotPlot(object = object, genes.plot = c("Gene1", "Gene2"), plot.legend = TRUE, group.by = "cell_types")

Seurat::DotPlot(object = object, 
        genes.plot = c("Gene1", "Gene2"), plot.legend = TRUE, group.by = "tissue_types" )
</code></pre>

<p>For elegant representation of my data, I want to be able to have the information of the following plots into one plot.</p>

<p>I will be very grateful for any hint on how I can proceed to achieve an elegant presentation as well as information about other possible ways to graphically represent gene expression data for publication or presentation purposes.</p>

<p>Thank you in advance for your help.</p>

<p><a href="https://i.sstatic.net/lbsMg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lbsMg.png" alt="enter image description here"></a></p>

<scrnaseq><seurat>
Visualising gene expression across cell type and conditions in one plot, in Single Cell Sequencing data
# Visualising gene expression across cell type and conditions in one plot, in Single Cell Sequencing data

(Asked by: username_0 on 2019-01-14)

I am new to single cell sequencing data analysis but I have basic programming background in R and python. I want to be able to plot differential expression of two genes, Gene1 and Gene2, across three cell types and across three conditions on one plot. I have followed this tutorial to perform QC and various differential analyses using Seurat package on my data up till now. 
My data set is one object, containing information about the three cell types under three various conditions. The metadata slot of my data set contains information about my cell types as well as the conditions under which they are tested. Using the following DotPlot commands I am able to generate separate plots of gene expression with respect to cell type and with respect to condition:
Seurat::DotPlot(object = object, genes.plot = c("Gene1", "Gene2"), plot.legend = TRUE, group.by = "cell_types")

Seurat::DotPlot(object = object, 
        genes.plot = c("Gene1", "Gene2"), plot.legend = TRUE, group.by = "tissue_types" )

For elegant representation of my data, I want to be able to have the information of the following plots into one plot.
I will be very grateful for any hint on how I can proceed to achieve an elegant presentation as well as information about other possible ways to graphically represent gene expression data for publication or presentation purposes.
Thank you in advance for your help.

**Tags:** scrnaseq, seurat

---

## 1 answers

### Answer by username_1 on 2019-01-14. Score: 2

Try using SplitDotPlotGG, this will allow you to color the dots by some additional variable (eg condition).
In your case you would want to do something like this:
library(Seurat)

SplitDotPlotGG(object = object,
               genes.plot = c("Gene1", "Gene2"),
               plot.legend = TRUE,
               group.by = "cell_types",
               grouping.var = "tissue_types")

This would give a result similar to below (an example from https://satijalab.org/seurat/immune_alignment.html).

> **Comments:**
> **username_0**: Thank you very much, it works. However the plot does not appear (plotting space on Rstudio remains blank) when I set plot.legend = TRUE, but the plot does appear without a legend  when I set plot.legend = FALSE. How can I proceed to fix this? **@TimStuart**  
> **username_1**: You probably need to make the plotting device bigger  

---

