text: user3171: I have got the problem on how to write the italic script in RStudio. I used the script in the screenshot and got the error "Error in grobs[[i]]: subscript out of bounds." 
  
  user3415: The title is misleading as this error doesn't have anything to do with making the font italic. In Seurat v2, FeaturePlot does not return a ggplot2 object by default, so p in your case is NULL. You need to set do.return to TRUE in the FeaturePlot call.
  You should instead do:
  library(Seurat)
  
  p <- FeaturePlot(pbmc_small, head(pbmc_small@var.genes), do.return = TRUE)
  
  for(i in 1:length(p)) {
    p[[i]] <- p[[i]] + theme(plot.title = element_text(face = 'italic'))
  }
  
  cowplot::plot_grid(plotlist = p)
  
  
  
original_text: 3171: <p>I have got the problem on how to write the italic script in RStudio. I used the script in the screenshot and got the error "Error in grobs[[i]]: subscript out of bounds." <a href="https://i.stack.imgur.com/emCgW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/emCgW.jpg" alt="enter image description here"></a></p>
   3415: <p>The title is misleading as this error doesn't have anything to do with making the font italic. In Seurat v2, FeaturePlot does not return a ggplot2 object by default, so <code>p</code> in your case is <code>NULL</code>. You need to set <code>do.return</code> to <code>TRUE</code> in the FeaturePlot call.</p>
  
  <p>You should instead do:</p>
  
  <pre><code>library(Seurat)
  
  p &lt;- FeaturePlot(pbmc_small, head(pbmc_small@var.genes), do.return = TRUE)
  
  for(i in 1:length(p)) {
    p[[i]] &lt;- p[[i]] + theme(plot.title = element_text(face = 'italic'))
  }
  
  cowplot::plot_grid(plotlist = p)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/h9me4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h9me4.png" alt="featureplot"></a></p>
  