Heatmap Clustering

Hello,
My statistical analysis is about time-series + one factor (5-time points, one control and one test group-4 subjects/group). When I generate the heatmap, I get mixed clustering where phenotype and time and subject gets mixed. How can I separate them? Meaning how can I have a representation of the metabolites for phenotype and time 1 (4 subjects/group), phenotype and time 2 (4 subjects/group), etc without showing each subject individually? That type of heat map would provide a better illustration of the correlations of each metabolite for each time point per phenotype.
I hope someone can answer my question soon.
Thank you.