title: stacked violin plot of Seurat object
body: <p><a href="https://i.stack.imgur.com/TTh6m.jpg" rel="nofollow noreferrer">enter image description here</a>I made a stacked violin plot with 16 different clusters. I have also attached the figure.
  Here is the code:</p>
  <pre><code>
      modify_vlnplot&lt;- function(obj, feature, pt.size = 0,
  plot.margin = unit(c(-0.75, 0, -0.75, 0), &quot;cm&quot;),
  ...) {
  p&lt;- VlnPlot(obj, features = feature, pt.size = pt.size, ... ) +
  xlab(&quot;&quot;) + ylab(feature) + ggtitle(&quot;&quot;) +
  theme(legend.position = &quot;none&quot;,
  axis.text.x = element_blank(),
  axis.ticks.x = element_blank(),
  axis.title.y = element_text(size = rel(1), angle = 0),
  axis.text.y = element_text(size = rel(1)),
  plot.margin = plot.margin )
  return(p)
  }
  extract_max&lt;- function(p){
  ymax&lt;- max(ggplot_build(p)$layout$panel_scales_y[[1]]$range$range)
  return(ceiling(ymax))
  }
  StackedVlnPlot&lt;- function(obj, features,
  pt.size = 0,
  plot.margin = unit(c(-0.75, 0, -0.75, 0), &quot;cm&quot;),
  ...) {
  plot_list&lt;- purrr::map(features, function(x) modify_vlnplot(obj = obj,feature = x, ...))
  
  
  plot_list[[length(plot_list)]]&lt;- plot_list[[length(plot_list)]] +
  theme(axis.text.x=element_text(angle = 45, hjust = 1, vjust = 1),
  axis.ticks.x = element_line())
  
  #change the y-axis tick to only max value
  ymaxs&lt;- purrr::map_dbl(plot_list, extract_max)
  plot_list&lt;- purrr::map2(plot_list, ymaxs, function(x,y) x +
  scale_y_continuous(breaks = c(y)) +
  expand_limits(y = y))
  p&lt;- patchwork::wrap_plots(plotlist = plot_list, ncol = 1)
  return(p)
  }
  StackedVlnPlot(obj = S1, features = features)
  
  #Stacked violine plots
  
  </code></pre>
  <p>Now, I want to make a plot with 5 columns instead of 16 columns. Four selected clusters/columns and one last column containing total/average expression of rest (12) of clusters. Please tell me how I can do this. Thanks in advance, looking forward to a positive response.</p>