Heat Map With Labels

Heatmap diagram can be used to visualize tabulated dataset.  Correlation coefficient table generated in Origin is suitable to be represented this way. In addition, user may also want to label the exact Z value of each block in the heatmap for comparison as shown below. In this blog we will show the steps to generate such diagram. Please download the attached zip file to follow the steps. There is also a Result folder in the opj file to see the final result.

1. Open the attached opj, a Correlation Coefficient has been done. With Pearson1 sheet active, right click Column A(X) header and set it as Categorical. (already done)

2. Highlight all data in worksheet and choose Plot: Contour: Heat map menu.  In the dialog, set X and Y data info. as below and click OK to create heatmap.

4. The colormap levels are from -0.43 to 1. To change the levels to be from -1 to 1, right click the plot and choose Colormap: Set Levels context menu. Set the levels to -1 to 1. Increment by 0.4.

3. There is no direct way to turn on label on heatmap yet in Origin 2018. But we can convert the Pearson1 sheet into XYZ dataset and then use it to add label to each cell on heatmap. Go back to Pearson1 sheet. Highlight column B to E and choose Worksheet: Stack Columns… Select Long Name as Group Rows, and check Include Other Columns and Click OK.

4. You will get a new sheet called StackCol1. Put workbook and graph window side by side. Right click column A header and Set as X. Now Highlight column B mouse over the right edge of column B till the cursor changes into a graph icon. Drag the B(Y) data into the graph.

5. Double click in heatmap to open Plot Details dialog. On left panel, select 2nd plot. On Line tab, set Width to 0.

6. On Label tab, check the Enable checkbox, set Label From to Col(C), set Position to Center. Click OK.

7. Finally we can double click the color scale title and change it to Correlation Coefficient. Double click the color scale and Select Levels in the left panel, check the checkbox Hide Head and Tail Levels on the right.  the The final graph should look like below:

Leave a Reply

Your email address will not be published. Required fields are marked *