Answers.Body: <blockquote>
  <p>how to get this to arrange the UMAP plots into a 2x3 grid</p>
  </blockquote>
  <p>You can use the <code>ncol</code> parameter, which will set the number of columns in the &quot;combined plot&quot;.</p>
  <p>And for future reference, if you get the help page of the function you are using with <code>?DimPlot</code>, you will see the <code>...</code>. This means that you can feed additional arguments to other functions that <code>DimPlot()</code> uses. Apparently, <code> CombinePlots()</code> is used under the hood and has an <code>ncol</code> parameter.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-31T17:10:49.687Z
Answers.Text: Thank you! ncol solved my problem! Here's the code I ended up using to get the columns and samples ordered, not sure if it was the most straightforward though, but works:
  
  object$orig.ident <- factor(x=object$orig.ident, levels = c("A", "B", "C", "X", "Y", "Z"))
  
  DimPlot(object, reduction = "umap", split.by = "orig.ident", ncol =3)
Answers.UserDisplayName: astro_guy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-30T09:02:01.597Z
Answers.LastActivityDate: 2020-07-30T09:02:01.597Z
Answers.UserDisplayName: haci
Body: <p>On my merged seurat object of 6 samples, when I use the split.by function in tandem with the Dimplot/UMAP plot, all six samples are displayed in series along a commonly labeled 'UMAP_1' x-axis in an order of (these are arbitrary for simplicity, here) Z, Y, X, C, B, A. Instead, I would like to specify these plots to output as a 2 row x 3 column arrangement ordered (1st Row) A, B, C and (2nd Row) X, Y, Z.</p>
  <p>I'm assuming I could use something like: group_levels &lt;- c(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;X&quot;, &quot;Y&quot;, &quot;Z&quot;) to define the order I'd like, but I'm lost on how to get this to arrange the UMAP plots into a 2x3 grid I'd like.</p>
  <p>Appreciate any help!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-29T21:04:20.233Z
Comments.Text: can you post the code or show with an example dataset (e.g pbmc_small in Seurat) ? I think it is a bit hard to follow in words what you need
Comments.UserDisplayName: StupidWolf
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-29T21:05:16.273Z
Comments.Text: I am sure you would prefer an answer with working code, so i encourage you to do the same here
Comments.UserDisplayName: StupidWolf
Tags: <seurat><single-cell>
Title: Help with setting DimPlot UMAP output into a 2x3 grid in Seurat
ThreadText: # Help with setting DimPlot UMAP output into a 2x3 grid in Seurat
  
  (Asked by: username_0 on 2020-07-29)
  
  On my merged seurat object of 6 samples, when I use the split.by function in tandem with the Dimplot/UMAP plot, all six samples are displayed in series along a commonly labeled 'UMAP\_1' x-axis in an order of (these are arbitrary for simplicity, here) Z, Y, X, C, B, A. Instead, I would like to specify these plots to output as a 2 row x 3 column arrangement ordered (1st Row) A, B, C and (2nd Row) X, Y, Z.
  
  I'm assuming I could use something like: group\_levels <- c("A", "B", "C", "X", "Y", "Z") to define the order I'd like, but I'm lost on how to get this to arrange the UMAP plots into a 2x3 grid I'd like.
  
  Appreciate any help!
  
  **Tags:** seurat, single-cell
  
  > **Comments:**
  > **username_1**: can you post the code or show with an example dataset (e.g pbmc_small in Seurat) ? I think it is a bit hard to follow in words what you need  
  > **username_1**: I am sure you would prefer an answer with working code, so i encourage you to do the same here  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-07-30. Score: 2 | Accepted answer
  
  > how to get this to arrange the UMAP plots into a 2x3 grid
  
  You can use the `ncol` parameter, which will set the number of columns in the "combined plot".
  
  And for future reference, if you get the help page of the function you are using with `?DimPlot`, you will see the `...`. This means that you can feed additional arguments to other functions that `DimPlot()` uses. Apparently,  `CombinePlots()` is used under the hood and has an `ncol` parameter.
  
  > **Comments:**
  > **username_0**: Thank you! ncol solved my problem! Here's the code I ended up using to get the columns and samples ordered, not sure if it was the most straightforward though, but works:  object$orig.ident <- factor(x=object$orig.ident, levels = c("A", "B", "C", "X", "Y", "Z"))  DimPlot(object, reduction = "umap", split.by = "orig.ident", ncol =3)  
  
  ---
  
  