1.33 FAQ-149 How do I insert superscripts, subscripts and Greek symbols into plot legends and axis titles, from worksheet headers?

Last Update: 9/23/2022

Graph axis titles and legends are special text labels that are generated from programmatically-linked data stored in the worksheet column label rows. Therefore, when planning to add special characters to axis titles or legends, it is easiest to add the characters to the label rows rather than trying to add them to these objects by direct edit.

FAQ-149 Image3.png

Related FAQ:: FAQ-148 How Do I Insert Special Characters into Text Labels?

Rich Text

To add complex formatting including superscripts and subscripts to worksheet cell text, you must have rich text enabled. By default, rich text is enabled only in Units and User-defined Parameter rows:

  1. Right-click on a row or cell in the worksheet and choose Set <object> Style: Rich Text from the bottom of the shortcut menu.
  2. Alternately, right-click in the gray area to the right of the worksheet columns and choose Properties. Click the Format tab and enable Rich Text, set Apply To and click OK.

Special Characters, Versions 2018 and Newer

Prior to Origin 2018, you had to enable rich text to enter special characters into column label row cells. This is no longer the case as the Origin worksheet now supports Unicode.

  1. Double-click into the worksheet cell to enter edit mode.
  • Enter the 4-character hex code for a (Unicode) codepoint (e.g. 03BB for "λ"), then press ALT+X. The codepoint is inserted.
  • Alternately, right-click and choose Symbol Map (CTRL+M), choose your character and Insert (for information on the Simple and Advanced Symbol Maps, see this topic).

Notes:

  • When inserting Unicode characters using the 4-character hex code and ALT+X, if the currently selected font does not include the character, you will have to switch fonts. For guidance on which fonts support which characters, you can check this external website.
  • If you want to plan to save the project to the older (pre-2018, pre-Unicode) opj format, you will need to enable rich text and use the Symbol Map dialog to insert special characters. For instructions, see the next section.

Special Characters, Versions 2017 and Older

Versions of Origin prior to Origin 2018 do not support Unicode. To enter special characters into the worksheet, you must enable rich text. See Rich Text, above.

Versions 9.0 to 2017:
Origin versions 9.0 and later support rich text for both the header (column label row) and data portions of the worksheet. You will need to enable rich text before adding special characters by Symbol Map, or when using the Format toolbar buttons (Greek, Super/Subscript, etc.) to format text.

Versions prior to 9.0:
In earlier versions, you can format text in worksheet column labels using Escape Sequences.
The shortcoming here is that some formatting options -- for instance, subscript and superscript -- do not display properly in the worksheet (e.g. \+(o) will convert the symbol "o" to superscript in the graph legend or axis title but the worksheet cell is only capable of displaying the escape sequence notation).

Superscript longname legend title.png

Setting up the graph to use worksheet header row data in legends and axis titles

Legend Text Customization: Double-click on the graph window to open Plot Details. In the left panel select the graph icon, then on the Legends/Titles tab to the right, set the Auto Legend Translation mode to use your header text. If none of the available options works for you (note that there is an @U: Long Name & Units option), choose Custom and see Legend Text Customization.

Axis title customization: There are two controls on the Legend/Titles tab that are useful for configuring axis titles to use worksheet information. For information on this and further axis title customization, see Axis Dialog Box, Title Text.

FAQ-149 Image4.png

You can save your graph legend and axis title customizations with your graph template by choosing File: Save Template As. For more information, see Origin Template Files.

You can directly edit the text in axis titles and legend objects by double-clicking on the object. This puts you into in-place edit mode where you can overwrite the hidden LabTalk variables that link the title or legend text to worksheet metadata. This is a "quick and dirty" method not generally suited to saving of templates but if static text is acceptable, this will work. If you are trying to enter special characters to text labels in this way, see FAQ-148 How Do I Insert Special Characters into Text Labels?


Keywords:Unicode, ALT+X, angstrom, degree, math, German umlaut, diaeresis, acute, tilde, accent mark, macron, circumflex, Planck's Constant, Planck, Pi, superscript, subscript, worksheet headers