0

I would like to put together a more publication-worthy (and more easily produced) version of the diagram that I've hacked together below:

hacked together diagram

Basically, it's a two part illustration with an HTML table on the left (showing different cluster assignments from varying parameters) and a modified dengrogram plot on the right.

I'm guessing it's apparent from the snapshot what I'm trying to add to the plot… Basically it could be a set of horizontal, stacked bars that show how the different parameters grouped the observations into different clusters. I used brackets with the cluster numbers when drawing these by hand, but anything that underlines the right observation numbers would be acceptable.

I realize there are two parts to this question: How to get the two-up layout when one of the panels is HTML instead of a figure, and how to modify the plot. [If only one part gets answered here, I can ask for the other in a separate question.]

Kaelin Colclasure
  • 3,925
  • 1
  • 26
  • 36

1 Answers1

1

You can label your plot using line and text. You need to set the clipping property to off in order for lines to show up outside of your axes. Here's an example:

data = [1,3,4,5; 2,6,7,8; 9,3,7,4;3,8,5,2];
tree = linkage(data,'average');
figure()
dendrogram(tree)
set(gca,'Position',[0.13, 0.3,0.775, 0.65])

h1 = line([1,1],[4,4.8],'Color','k');
h2 = line([1,3],[4,4],'Color','k');
h3 = line([3,3],[4,4.8],'Color','k');
set(h1,'Clipping','off')
set(h2,'Clipping','off')
set(h3,'Clipping','off')

ht = text(1.7,3.9,'Label');
Molly
  • 13,240
  • 4
  • 44
  • 45