Is it possible to change axis labels in the data viewer?

The axis labels used in the data viewer can be changed, though you must use expert mode to make the changes. For example, let's change one of the axis labels used in the Sandwell Seafloor dataset.

You can see that the latitude label and units in a plot of these data are less than ideal. To change this axis label, go back to the dataset page and select the Expert Mode link in the Function Bar at the top of the page.

Click here to begin example.

  1. Rename the grid representing latitude (e.g., North) to "Latitude" by putting the following Ingrid command in the text box below the text that is already there.
    Y   /long_name (Latitude)
    def
  2. Redefine the units of the Latitude grid to "degree_north" by putting the following Ingrid command in the text box below the text that is already there.
    Y    /units (degree_north)
    def

    To explain the next step, you should have some background as to how Ingrid works. Ingrid uses an operand stack which holds objects that are the operands and results of Ingrid operators. When an operator requires one or more operands, it obtains them be popping them off the top of the operand stack.* Therefore, in this case, the data must be on the top of the stack in order for Ingrid to create an image with it.

    You have now renamed both the grid name and units that are used to create the label. In doing so, however, you have placed two items on top of the data in the stack. In other words...

    The current order in the stack is:
    Results of Step 2
    Results of Step 1
    Data

    To plot the data, we want the stack to be:
    Data
    Results of Step 2
    Results of Step 1

    To put the data that is be plotted back on the top of the stack, we use a command called "index", which counts down to the indicated element in the stack and pushes a copy of that element on the top of the stack.

  3. Push a copy of the data to the top of the stack by putting the following Ingrid command in the text box below the text that is already there. Note: the element on the top of the stack is labeled as element 0, so the data is element 2.
    2 index
    
  4. Click "OK".

    Your page should now look like this.

  5. Select the desired view from the views links in the Function Bar and note how the latitude label has changed.

*From PostScript Language Reference Manual

-- Michael Bell/Emily Grover