# Gene\_A x Gene\_B Plot

**URL:** <https://help.c-moor.org/t/gene-a-x-gene-b-plot/228>\
**Category:** Code Cookbook\
**Created:** [April 11, 2022, 5:54pm UTC](https://help.c-moor.org/t/gene-a-x-gene-b-plot/228 "2022-04-11T17:54:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LindsayHayes](https://yyz1.discourse-cdn.com/flex027/user_avatar/help.c-moor.org/lindsayhayes/32/14_2.png) [@LindsayHayes](https://help.c-moor.org/u/LindsayHayes)\
**Post date:** [April 11, 2022, 5:54pm UTC](https://help.c-moor.org/t/gene-a-x-gene-b-plot/228/1 "2022-04-11T17:54:45Z")

</div>

If you want to check if the same cells express 2 different genes you can plot one gene on the x-axis and the other gene on the y-axis using the `plot()` function.

From this code just update the gene names (here “Kdm5d” & “Uty”) to your 2 genes of interest!

```auto
gene_A <- which(rowData(sce)[,2] %in% "Kdm5d")
gene_B <- which(rowData(sce)[,2] %in% "Uty")
plot(logcounts(sce)[gene_A,], logcounts(sce)[gene_B,], xlab="Kdm5d", ylab="Uty")

```

The genes along the x-axis only express the gene\_A, genes along the y-axis only express gene\_B, and genes along the diagonal express both genes.
