title: How to produce a geom_line graph above heatmap?
body: <p>Im trying to produce a heatmap of circadian gene expression data and above it to show the behavior measured.</p>
  
  <p>i want it to look somthing like this:
  <a href="https://i.stack.imgur.com/LXHuF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LXHuF.png" alt="enter image description here"></a> </p>
  
  <p>Note the 2 red dots should be above CT13 and CT37 (respectively)...</p>
  
  <p>this is the code i tried to use but it produces 2 separated graphs:</p>
  
  <pre><code>library(pheatmap)
  library(RColorBrewer)
  library(ggplot2)
  
  # prepare data for Heat map:
  my_heatmap &lt;- read.csv("circ_genes.csv", header = TRUE)
  mymat &lt;- my_heatmap[,c(2:13)]
  rownames(mymat) &lt;- paste("Gene", my_heatmap[,1], sep="_")
  mydf &lt;- data.frame(row.names = paste("Gene", my_heatmap[,1], sep="_"), 
  category = my_heatmap[,14])
  my_palette &lt;- colorRampPalette(c("blue", "white", "red"))(n = 1000)
  
  # prepare data for line graph
  behavior_LD &lt;- read.csv("behavior.csv", header = TRUE)
  CT &lt;- behavior_LD$CT
  CT &lt;- as.character(CT)
  behavior_LD$CT &lt;- factor(behavior_LD$CT, levels = CT )
  mycolours &lt;- c("H1" = "red", "H0" = "black")
  
  behavePlot &lt;- ggplot(data=behavior_LD, aes(x=CT, y=Average, group=1)) +
    geom_line()+
    geom_point(aes(colour = factor(highlight)), size = 3) +
    geom_errorbar(aes(ymin=Average-SE, ymax=Average+SE), width=.1)+
    scale_color_manual(values = mycolours) + theme(legend.position="none") +
    theme(axis.title.x=element_blank(),
          axis.text.x=element_blank(),
          axis.ticks.x=element_blank()) +
    theme(plot.margin=unit(c(5,2,5,2),"cm"))
  
  # plot 2 graphs
  par(mfrow=c(2,1))
  
  behavePlot
  
  pheatmap(mymat, color = my_palette, legend_labels = "Clusters", cluster_cols 
  = F, cluster_rows = F, annotation_row = mydf, gaps_row = c(43, 60, 88, 124), 
  annotation_names_row = FALSE, show_rownames = FALSE )
  </code></pre>
  
  <p>files i used can be found in here:
  <a href="https://www.dropbox.com/sh/n3mplr0fdz7oh6f/AACU_CdVjT6OmJLzrKmAtxj2a?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/sh/n3mplr0fdz7oh6f/AACU_CdVjT6OmJLzrKmAtxj2a?dl=0</a></p>
  
  <p>thank you for your help!</p>