1.183 FAQ-874 How to color regions in a line plot?

Last Update: 10/26/2017


To color some regions in a line plot, you can use the Cluster gadget to group the regions into categories and then color-map line plot by the categorical data.

For example, to highlight peak A and B with different colors in the following line plot,

How to color regions in lineplo 01.png

  1. With the graph active, select Gadgets: Cluster.
  2. In the dialog, select Circle for Shape on ROI Box tab since a circle ROI is more flexible to cover the peak region. Click OK and a ROI circle is put to the graph.
  3. Move the ROI area peak A. Drag the 8 anchors to adjust the size and shape of the ROI so it can cover the region of peak A as desired.
  4. Click the Create Categories button Button Create Categories.png on the Cluster Gadget: Editing Inner Points dialog.
  5. In the Create Categorical Value dialog, name your category group and give a categrocial value to the data points in the ROI region. Check Color Data by Category checkbox, then this categrocial value will be set as the data plot color index.
    How to color regions in lineplo 02.png
  6. Repeat steps 3 to 5 to select region of Peak B and set the categorical value.
  7. You can click the Go to Source Worksheet button Cluster Gadget Go to Source Worksheet button.png to go to the source data. A "Group" column is added, containing the categorical values you just specified.

Finally we get the following plot.

How to color regions in lineplo 04.png

Note: the Cluster gadget is for Pro only.

Keywords:line curve, colormap, region of plot, color peaks