title: How to change plotting parameters of a function within a wrapper (R)
body: <p>I'm trying to generate heatmaps by using <code>cellrangerRkit</code> package. The function within this package refers to <code>pheatmap</code> function featured in <code>pheatmap</code> library as seen below:</p>
  
  <pre><code>gbm_pheatmap
  function (gbm, genes_to_plot, cells_to_plot, n_genes = 5, colour = NULL, 
            limits = c(-3, 3)) 
  {
    if (!is.list(genes_to_plot)) {
      cat("Plotting one gene set instead of multiple cluster-specific gene sets\n")
      gene_indices &lt;- sapply(genes_to_plot, function(x) get_gene_index(gbm, 
                                                                       x))
      gene_annotation &lt;- NULL
    }
    else {
      if ("significant" %in% names(genes_to_plot[[1]])) {
        gene_indices &lt;- unlist(lapply(genes_to_plot, function(x) with(x, 
                                                                      head(ix[significant], n_genes))))
        gene_grouping &lt;- unlist(lapply(names(genes_to_plot), 
                                       function(nm) rep(nm, with(genes_to_plot[[nm]], 
                                                                 length(head(ix[significant], n_genes))))))
      }
      else {
        gene_indices &lt;- unlist(lapply(genes_to_plot, function(x) x$ix[1:n_genes]))
        gene_grouping &lt;- rep(names(genes_to_plot), each = n_genes)
      }
      gene_annotation &lt;- data.frame(ClusterID = as.factor(gene_grouping))
    }
    cell_indices &lt;- unlist(lapply(cells_to_plot, function(x) x$ix))
    value &lt;- t(scale(t(as.matrix(exprs(gbm))[gene_indices, cell_indices])))
    value[value &lt; limits[1]] &lt;- limits[1]
    value[value &gt; limits[2]] &lt;- limits[2]
    rownames(value) &lt;- make.unique(fData(gbm)$symbol[gene_indices])
    cell_grouping &lt;- unlist(lapply(1:length(cells_to_plot), function(x) {
      rep(names(cells_to_plot)[x], length(cells_to_plot[[x]]$barcode))
    }))
    cell_annotation &lt;- data.frame(ClusterID = as.factor(cell_grouping))
    rownames(cell_annotation) &lt;- colnames(value)
    if (!is.null(gene_annotation)) {
      rownames(gene_annotation) &lt;- rownames(value)
    }
    if (is.null(colour)) {
      anno_colors &lt;- NULL
    }
    else {
      names(colour) &lt;- names(cells_to_plot)
      anno_colors &lt;- list(ClusterID = colour)
    }
    pheatmap(value, cluster_rows = FALSE, cluster_cols = FALSE, 
             show_colnames = FALSE, annotation_row = gene_annotation, 
             annotation_col = cell_annotation, annotation_names_row = FALSE, 
             annotation_names_col = FALSE, annotation_colors = anno_colors)
  }
  &lt;bytecode: 0x00000000507b7970&gt;
    &lt;environment: namespace:cellrangerRkit&gt;  
  </code></pre>
  
  <p>My problem is that, when I plot my heatmap, the annotation on the right side of the plot is overlapping due to large font size (see below) <a href="https://i.stack.imgur.com/I6rqo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I6rqo.png" alt="ugly heatmap"></a></p>
  
  <p>The wrapper function <code>gbm_heatmap</code> doesn't have a <code>fontsize</code> option, preventing me from simply passing an argument when calling it. How I can change the plotting behavior within this wrapper?</p>
  
  <p>Appreciate all the input, thanks!</p>