1.37 FAQ-153 How do I customize the legend?

Last Update: 5/15/2019

Customizing the Text Part of Legend

The text in legend by default will show the column comments. You can either type in any literal or use Update Data Plot Legend dialog to use other column information, such as long name, units, user-defined parameters, worksheet name, etc.

  1. Right click legend and choose Legend: Update Legend.... Choose Graph: Legend: Update Legend... menu
  2. Change syntax in Auto Legend Translation mode dropdown list. To know more about updating the legend text, please refer to How do I modify the legend?.
  3. You can also choose Custom' and see more syntax and combine literal text and syntax.
Customize legend text.gif

Note:

  • Such controls also exist on Legend/Titles tab of Page Properties dialog. Select Format: Page... to open Page Properties dialog.
  • To make text color follows the plot color, right click the legend and choose Legend: Text Color Follow Plot context menu.
  • Legend settings can be saved in graph template for future use.


To force a line break in your custom legend text use %(CRLF):

Legend carriage return.png
  • In the legendupdate dialog box, set Auto Legend Translation Mode to Custom and insert "%(CRLF)" into your format string.
  • You can do the same thing in Plot Details. Go to the Legends/Titles tab, set Translation mode of %(1), %(2) to Custom and enter your custom legend text, to include "%(CRLF)" at the point where you want the text to break to a new line.

Customize the Symbol Part of Legend

Adjust Symbol Size

By default, the symbol part in legend follows the plot size. If the symbol in plot is too tiny or line plot thickness too small, it's hard to read the legend. Or for column/bar/area plot, Origin always creates fixed size rectangle block in legend. You may want to adjust the block width or height to make it nice looking. To do all these,

  1. In Origin 2018 and newer, double click the legend or right click the legend and choose Properties context menu. Go to Symbol tab to adjust the scaling.
    Customize legend Symbol.gif
    Note: On Symbol tab, you can also display Line+Symbol legend as dumbbell shape (symbol-line-symbol) and adjust gap between symbol and line.
    And, the Pattern Block Width and Pattern Block Height box can be used to adjust the width and height of a block-style legend symbol(such as Column/Bar ), but they will not take numbers larger than 100.
  2. In Origin 2017 and earlier, you can adjust symbol size by Legend Substitution Notation

Create New Symbol Entries

  1. In Origin 2018 and newer, double click the legend or right click the legend and choose Properties context menu to open Text Object - Legend dialog. On Text tab, click Add Legend Symbol button to design your symbol in legend. it supports line, arrow, symbol, line+symbol kind of legend symbols.
    Customize legend Add Symbol.gif
  2. In Origin 2017 and older, you will need to refer to Indepdent Symbol in Legend section to construct it manually.

Customize the Layout of Legend

Some new improvements are added over the years of how to organize the legend. The minimum version for the feature is added at the end of the line.

  1. To reverse Legend entries, right click legend and choose Legend: Reverse Order. (Origin 2015)
  2. To arrange legend Horizontally, right click legend and choose Legend: Arrange in Horizontal. (Origin 2016)
  3. To arrange legend in mulitple columns, press Ctrl key and drag the border of legend. (Origin 2015).
  4. To add more white margin white legend box, click the legend border line till double border shows. Drag the border line.
  5. To add more spacing between entries, right click the legend and choose Properties.... Adjust Line Spacing.(Origin 2016)

Keywords:dataset, symbol, special, ini, length of legend, width of legend, legend symbol size, add legend entries


Please read the details in User Guide.