Imagine the Universe!
Imagine Home  |   Teachers' Corner | HERA Overview  | College Hera |  

Plotting Basics

Teachers' Hera has been set up to automatically display outputs such as plots in a POW window. The plotting package used to generate these plots is called PLT, and outputted plots can be changed by typing in commands at the PLT> command prompt in the text output window. After typing in a command, if the plot does not refresh, just type "p" and hit return to redraw the plot. Some basic commands that you may find useful are listed below:

  • Getting help: Like all good interactive programs, PLT has on-line help. To access it, type "help" at the PLT> prompt.
  • Rescaling: After setting the plot device, the plot will appear. If you want to rescale the x-axis to run, say, between values of 100 and 250:

    PLT> r x 100 250

    Rescaling the y-axis works in the same way; e.g. r y 0.8 1.2 will redraw the y-axis to run between 0.8 and 1. And if you want to combine both rescalings in one, command:

    PLT> r 100 250 0.8 1.2

  • Labelling: To change the existing labels or to add new ones, the "label" command (abbreviated to la) is used. For example, here's the command for putting a label on the x-axis saying "Time (MET in seconds)":

    PLT> la x Time (MET in seconds)

    You can put labels at these other locations in the same way:

    top .. at the top of the plot, above the plot window
    otop . over the top label
    y .... on the y-axis
    oy ... over the y-axis label
    ox ... below the x-axis label
    f .... at the default filename location (above the top left corner of the plot window)

  • Removing the error bars: To remove the error bars on a plot, the command "error off" (abbreviated err off) is used.

    PLT> err off

  • Connecting the points of a plot: To connect the points in a plot, use the command

    PLT> line step

  • Logarithmic scales: The commands "log x" and "log y" will make the x and y-axes logarithmic. To restore the linear scale, type "log off". Make sure, before using this command, that all you points are greater than zero. If not, you should rescale before the log conversion.
  • Removing the time label: By default, PLT puts the time at which the plot was made on the bottom right-hand corner. To remove it:

    PLT> t off

    The command "t on" will restore it.

  • Rotating the numbers on the y-axis: The command "la ro" will make the numbers on the y-axis read horizontally rather than vertically.
  • Changing the window size: The rectangular window containing the plot itself is known as the viewport and can be changed in size and shape. The viewport configuration is given by the coordinates of its bottom left and top right corners - in dimensionless units such that the length and breadth of the screen are both unity. The default is (0.1, 0.1, 0.9, 0.9) which provides a large viewport with space left for the labels. So, to change to a taller-looking window, you could type:

    PLT> vp 0.25 0.1 0.75 0.9

  • Thickening the width of lines: A useful command to apply before creating a hardcopy is "lw," short for "lwidth". It thickens all the lines and characters in the plot to increase its visibility - for, say, transparencies or figures that you intend to reduce in size for publication.

    PLT> lw 3

    for example, will make the lines three times thicker than the minimum, which is the default.

  • Changing the character size: The simple command "cs" will change the size of all characters by whatever factor follows it. For example:

    PLT> cs 1.5

    will increase the size of text by 50 percent.

If words seem to be missing from the articles, please read this.

Imagine the Universe! is a service of the High Energy Astrophysics Science Archive Research Center (HEASARC), Dr. Alan Smale (Director), within the Astrophysics Science Division (ASD) at NASA's Goddard Space Flight Center.

The Imagine Team
Project Leader: Dr. Barbara Mattson
Curator: Meredith Gibb
Responsible NASA Official: Phil Newman
All material on this site has been created and updated between 1997-2014.
This page last updated: Sunday, 16-Dec-2012 19:01:28 EST