1.2 Auto-Scaling Routines

The GRPH2 contains several packages that automatically sets parameters (such as window) for transformation functions such as USPACK and UMPACK. These packages are convenient for creating graphs for a given set of data without giving too much attention to the details of the parameters. However, the parameters set by the system are not necessarily the most suitable ones. By specifying some of the parameters, the quality of the final graph may be significantly improved.

To enable the "user to specify some of the parameters,"  the system must have information on "which parameters the user explicitly defined." Therefore, the concept of  "undefined value" is  introduced into GRPH2 as was the missing-value. The "undefined value" is the 'RUNDEF' and 'IUNDEF' handled by GLpGET/GLpSET.

The actual procedure involves:

1:
assigning an  "undefined value" to all parameters that can be automatically set before drawing a new plot; and
2:
letting the auto-scaling routine automatically set only the parameters that have "undefined values."
Assigning an "undefined value" in step 1 is performed by calling GRFRM and GRFIG in GRPACK. Therefore, to explicitly set some of the parameters, the user should call GRFRM instead of SGRFM, and set the parameters using routines such as GRSWND/SGSWND before calling the auto-scaling routine. When using a routine such as GRSWND, which sets multiple parameters at once, assign 'RUNDEF' to parameters that you do not want to set explicitly. The auto-scaling routine may operate slightly differently depending on the specified parameter.

For example, when the user defines all parameters (when the auto-scaling routine is not used),

 

      CALL GROPN(IWS)

      CALL GRFRM



      CALL GRSTRN(ITR)

      CALL GRSVPT(VXMIN, VXMAX, VYMIN, VYMAX)

      CALL GRSWND(UXMIN, UXMAX, UYMIN, UYMAX)



      CALL GRSTRF

      ........

will be made, but if the user wishes the USPACK to set appropriate parameters based on the information on the points to plot, 

      CALL GROPN(IWS)

      CALL GRFRM



      CALL GRSTRN(ITR)

      CALL USSPNT(N, UPX, UPY)

      CALL USPFIT



      CALL GRSTRF

      ........

      CALL SGPLU(N, UPX, UPY)

      ........

will be made. In other words, in place of GRSWND and GRSVPT, the information USSPNT necessary to set them will be given. The necessary parameters will be set by a call to USPFIT, and the transformation function will be made effective by a call to GRSTRF. When the user wishes to explicitly set only some of the parameters, they should be set using routines such as GRSWND and GRSVPT in between the calls to GRFRM and GRSTRF. For example, if
 

      CALL GROPN(IWS)

      CALL GRFRM



      CALL GRSTRN(ITR)

      CALL GRSWND(UXMIN, UXMAX, RUNDEF, RUNDEF)

      CALL USSPNT(N, UPX, UPY)

      CALL USPFIT



      CALL GRSTRF

      ........

      CALL SGPLU(N, UPX, UPY)

      ........

are made, only the maximum and minimum values of the Y axis will be set automatically.