I have an array where the ij th entry is the number of genes common to areas i and j that are differentially expressed in i with respect to j.
Labeling every xtick and ytick will make the graph too crowded. Similar to this question and this question I want to group labels on my x-axis.
The xticklabels of the heat map in the following image from Hawrylycz et al (2012) are a good example of what I want The xticklabels refer to more general regions. For example, all the columns under frontal lobe corrsepond to structures in the brain within the frontal lobe.
I am not trying to replicate the yticklabels, or bar graph inset.
My approach
For each box in the heat map I have an ontology. I am choosing to plot structures in a few regions, for example only the "frontal lobe and parietal lobe."
Using the ontology I can discover the start and end index of the group of columns for each structure. How do I use those indices to draw a group label?