SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search Dataplot Pages

Dataplot: Text Subcommands

Introduction An important feature of the TEXT, TITLE, LABEL, and LEGEND commands is the ability to use within-text subcommands to specify the following:
  1. To temporarily change the case (upper versus lower) in mid-text. For example, leading characters of words can be upper case and trailing characters can be lower case.
  2. To shift to subscripts and superscripts in mid-text.
  3. To generate Greek letters.
  4. To generate mathematical symbols (for example, integral sign, partial derivative sign, etc.).
  5. To generate other special symbols (for example, brackets, arrows, carats, daggers, etc.).
Software Font Required The above may be done whenever the Hershey fonts (simplex, duplex, triplex, triplex italic, complex, simplex script, and complex script) have been specified (see the FONT command). The only special symbols recognized with hardware fonts are the in-line case shifts (i.e., upper and lower case) and the space character.

Note:There are a few exceptions to this.

  • The sp() (to insert a space) and cr() (to insert a carriage return) are supported for hardware fonts for all devices.

  • The Postscript device supports subscripts and superscripts. In addition, it supports Greek characters and many mathematical and special symbols via the SYMBOL font. In Dataplot, you can enter HELP POSTSCRIPT for a list of the specific symbols that are supported.

  • The libplot device can also support subscripts and superscripts, Greek characters, and a few of the special symbols.
Some Examples Within-text subcommands (indicators) are used to specify the desired text operations. For example:
  • UC() to shift to capital letters;
  • SUB() to shift to subscript mode;
  • ALPH() to draw a Greek alpha;
  • INTE() to draw an integral;
  • RBRA() to draw a right bracket.
() Used to Denote Within Text Subcommands The within-text subcommands are all distinguished by an appended (). The () is a flag to Dataplot that the previous character sub-string is not to be printed literally but rather should be converted and acted upon in a special fashion.

Case
Default is Upper Case Dataplot by default prints all text in upper case. Simply entering the text in lower case is not sufficient to have it printed in lower case. This is a throwback to Dataplot's early years when many terminals did not support lower case characters.
Case Shifts Within Text Strings Shifts between capitalized letters and non-capitalized letters can be carried out within text strings generated by any TEXT, TITLE, LABEL, or LEGEND command. Case shifts are recognized for both hardware and software generated text.
Two Methods for Case Shifting There are two methods for shifting case in Dataplot strings.
  1. To shift to upper case, enter UC(), CAPS(), or CAP() followed by the desired text sub-string. To shift to lower case, enter LC() followed by the desired text sub-string.
  2. Use one of the CASE commands (CASE, TITLE CASE, LEGEND CASE, LABEL CASE). You can set the case to UPPER, LOWER, or ASIS. The ASIS option allows you to type the case of the characters directly. The default case is UPPER. You can place the commands
      CASE ASIS
      TITLE CASE ASIS
      LEGEND CASE ASIS
      LABEL CASE ASIS
    in the Dataplot start-up file DPLOGF.TEX to make the default that text is printed in the case entered. This is generally more convenient than entering a large number of UC() and LC() strings.
Within Text Case Shift Overrides CASE Command Setting The within-text case shifting overrides the setting from the CASE command. If the within-text case shift takes place mid-line, then the first part of the text string follows whatever the current setting is as given by the CASE command. At the end of a text line with a case shift, the current CASE command setting takes effect again.
Some Examples For example, go to the middle of screen, and write out "DATAPLOT is from NIST" with all symbols in simplex font:
    CASE UPPERS
    FONT SIMPLEX
    MOVE 50 50
    TEXT DATAPLOT LC()IS FROM UC()IST
As another example, go to the middle of screen, and write out "Future Goals" in triplex font:
    FONT TRIPLEX
    MOVE 50 50
    TEXT UC()FLC()UTURE UC()GLC()OALS

Subscripts/Superscripts
Software Font Required Subscripts and superscripts can be generated within any TEXT, TITLE, LABEL, or LEGEND command whenever the Hershey fonts (simplex, duplex, triplex, triplex italic, complex, simplex script, and complex script) have been specified (see the FONT command).
Codes to Designate Subscripts and Superscripts To shift to subscript mode, simply enter SUB() followed by the desired subscript. To terminate subscript mode, enter UNSB() and continue on with the desired text. Similarly, SUP() shifts into superscript mode, and UNSP() shifts out of superscipt mode. The () is a flag to Dataplot that the previous character sub-string is not to be printed literally but rather should be converted and acted upon in a special fashion. It is an indicator that is used not only for sub/super-scripting, but also for Greek symbols, mathematics symbols, and other special symbols.
Points Regarding Subscripts and Superscripts The following are some points to note regarding subscripts and superscripts.
  • Subscript and superscript strings can be of any length.
  • Nested subscripts and superscripts are permitted seven deep.
  • The size of a sub/super-script is always half the size of the previous level.
Tables Showing the Subscript and Superscript Indicators The sub/super-script indicators are given in the following table.
    SUB() subscript
    UNSB() un-subscript
    SUP() superscript
    UNSP() un-superscript
Some Examples For example, go to the middle of screen, and write out
    e = mc squared (Einstein's classic equation)
with all symbols in lower case simplex font:
    CASE LOWER
    FONT SIMPLEX
    MOVE 50 50
    TEXT E = MCSUP()2S

As another example, go to the middle of screen, and write out

    T (with superscript *) = e (with superscript integral f)
in lower case triplex font:
    CASE LOWER
    FONT TRIPLEX
    MOVE 50 50
    TEXT TSUP()*UNSP() = ESUP()INTE()F

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 06/05/2001
Last updated: 09/20/2016

Please email comments on this WWW page to alan.heckert@nist.gov.