6.8.6 Create Heatmap with Virtual Matrix and Colormap Bar Plot


Video Image.png Video Text Image.png Website blog icon circle.png Blog Image 33x33px.png


Summary

This tutorial create two kinds of graph, a Heatmap Plot based on a virtual matrix together with a Bar Plot with Color Map, and merged them together.
Heatmap-21.png

Minimum Origin Version Required: 2015 SR0

What you will learn

This tutorial will show you how to:

  • Create Heatmap Plot based on an Virtual Matrix.
  • Create Bar Plot with Colormap.
  • Merge the Heatmap Plot and Bar Plot together.

Steps

Create Heatmap Plot from Virtual Matrix

This tutorial is associated with <Origin EXE Folder>\Samples\Tutorial Data.opj.

  1. Open the Tutorial Data.opj and browse to the folder Heatmap and Virtual Matrix Manager. Open workbook Electricity Usage with first sheet active.
  2. The XYZ mapping of workbook is shown in graph below, this will help you to understand how the Heatmap plot is created in next steps:
    Heatmap-01.png
  3. Highlight all cells in Z region by selecting the Cell in Column(B)-Row 1, then pressing CTRL+SHIFT+END. Click Plot > Contour: Heatmap in main menu to open the plotvm dialog for Heatmap plot.
  4. Specified the X, Y ranges as shown in graph below.
    Heatmap-02.png
  5. In this dialog, check Format X Data and Format Y Data check boxes, click the button Button ....png respectively to format X and Y data following the image below, then click OK to close the dialog.
    Heatmap-03.png
  6. The tick labels in Y axis are too dense to be seen, so now we are going to change that. Double click the axis in the graph to open the Axis dialog:
    • Select Left icon in Tick Labels tab, go to Display tab, select Date as the Type, and set Display drop-down list to Dec(Current Month), click Apply to save the setting.
    Heatmap-04.png
    • Go to the Table tab, check on Enable box, click Apply to save. You will find that the month names are shown as tick labels for Y axis in the form of a table.
    Heatmap-05.png
  7. Next, we will specify the scale and tick labels for X axis:
    • Go to Bottom icon in Tick Labels tab, and make sure Time is selected as the Type in Display tab, change the Display to hh pm, click Apply to save the setting.
    Heatmap-06.png
    • Go to Horizontal icon in Scale tab, make sure the settings resemble the screenshot below, click Apply to save the setting. Click OK to close the dialog. Remove the title for X axis.
    Heatmap-07.png
  8. Click the tick labels for both XY aixs in the graph, change the font size to 10 via Format Toolbar.
  9. Select Format: Plot in main menu with Heatmap graph active.
    • Set the Level for Colormap follows the graph below:
    Heatmap-19.png
    Click OK to close the Set Levels dialog
    • Click the Fill color of the Colormap on head cell(blue area) to set Fills follows the graph below:
    Heatmap-20.png
    • Scroll down to the Colormap tail, set its fill color to red in the same way.
    • Click Save in Colormap/Contours tab to save the pattern as heatmap.oth which will be used in the second parts of the graph.
    Heatmap-08.png
  10. In the Plot Details dialog, click the first tree node in left panel (should be Graph1 by default), change page size to 11*11 inch in Print/Dimensions tab, click Apply, then in the left panel, select the sub tree node for Layer1, go to the Size/Speed tab, change the Layer area follows graph below, click OK to apply the settings and exit the dialog:
    Heatmap-13.png
  11. We will turn off the speed mode by click the Button SpeedMode.png in Graph Toolbox to view the graph with higher resolution. The finished graph for Heatmap should be similar to the graph below:
    Heatmap-13-1.png

Once the Virtual Matrix were created, they will be saved internally. You can browse them in Virtual Matrix Manager. The saved Virtual Matrix can be used for Contour/Heatmap/3D surface plot directly, you can select the virtual matrix from the input box of the plot dialog as shown in graph below:

Heatmap-22.png

Create the Bar Plot with Colormap

  1. Go to the Temp sheet in Electricity Usage workbook, highlight the worksheet and select Plot > Basic 2D : Bar in main menu to create a Bar plot.
  2. Now, we will defined the style of axis:
    • Double click the axis to open the Axis dialog, change the Scale of axis (X) follows the graphs below in Vertical page of the Scale tab.
    Heatmap-12-1.png
    • Then, change the Scale for axis(Y) in Horizontal page from -55 to 55 with Major Ticks value 25 and Minor Ticks counts 1, then click Apply.
    Heatmap-12.png
    • We will also hide the line and ticks for X axis in Line and Ticks tab by uncheck the box of Show Line and Ticks. Besides, grids can be hide by using similar ways in Grids tab.
    • Click OK to close the dialog.
    • Change the Y axis title to CDD/HDD by double clicking on the Y title object and entering the in-place edit mode. Delete the ticks labels and axis title of X axis by select it and hit Delete key.
  3. Next, we will create the Colormap for the graph, the Colormap theme should be identical to the Heatmap created before. Click the Format: Plot in main menu to open the Plot Details dialog:
    • Set the color for both Border and Fill as Map:Col(B).
    Heatmap-09.png
    • Go to the Colormap tab, load the heatmap.oth as Colormap Theme.
    Heatmap-10.png
    • Click the Level of the Colormap to set Levels follows the graph below:
    Heatmap-11-2.png
    Click OK to close the Set Level dialog and Click Apply in Plot Properties dialog to save the settings.
  4. In the left panel, select the first tree node (by default, Graph2), change page size to 11*11 inch in Print/Dimensions tab, click Apply, then switch to the Layer1 tree node and go to the Size/Speed tab, change the Layer area follows graph below, then,click OK to close dialog:
    Heatmap-14.png
    The finished bar plot is similar to the graph below:
    Heatmap-14-1.png

Merge the Heatmap Plot with Bar Plot and More Customization Steps

  1. Select Graph: Merge Graph Window in main menu with Heatmap graph active, merge Graph1 and Graph2 together, the Rearrange Layout should be unchecked, click OK to apply the setting.
    Heatmap-15.png Then, you will resize the size of the merged graph (Graph3), click Format: Page >> Print/Dimensions tab, change the page size to 11*11 inch again, click OK. Click CTRL+W to adjust the graph view.
  2. Specify the style of the color scale:
    • Double click the color scale to open the Color Scale Control dialog, set the Levels page as shown in graph below:
    Heatmap-16.png
    • Set the Labels page as shown in graph below:
    Heatmap-17.png
    • Set the Layout page as shown in graph below:
    Heatmap-18.png
    Click OK to apply the settings, drag the outline of the color scale in the graph to reach a proper size and location.
  3. Select the unwanted axis title or legend and delete them, add text object with graph information by using text tool.
    The finished graph is similar to the graph below:
    Heatmap-21.png