1.264 FAQ-1065 How to label each line plot with a legend-type entry?

Last Update: 9/7/2020


In some situations, you might prefer labeling individual line plots with a legend-style entry, rather than having a standard legend.

FAQ1065 image 1.png

Beginning with Origin 2021, this is very easy:

  1. Select the standard legend object.
  2. Click the Attach to Plots button on the Mini Toolbar that pops up.
    FAQ1065 image 2.png
  3. Select the standard legend object and press Delete.


Version 2020b and Earlier:

  1. Choose Format: Plot to open Plot Details, then click the Label tab in the right panel.
  2. Set controls as in the following screenshot and set other controls as needed:
    FAQ1065 image 3.png

In this case, we are using the custom Format String %(wcol(n)[L]$) that labels the last point of each plot with the dataset Long Name, using Substitution Notation. Use of other plot metadata -- Units, Comments, etc. -- is certainly possible.


Keywords:plot label, data label, legend, line plot, line graph, Attach to Plots, substitution notation