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),

 

      NumRu::DCL.gropn(iws)

      CALL grfrm



      NumRu::DCL.grstrn(itr)

      NumRu::DCL.grsvpt(vxmin,vxmax,vymin,vymax)

      NumRu::DCL.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, 

      NumRu::DCL.gropn(iws)

      CALL grfrm



      NumRu::DCL.grstrn(itr)

      NumRu::DCL.usspnt(x,y)

      CALL uspfit



      CALL grstrf

      ........

      NumRu::DCL.sgplu(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
 

      NumRu::DCL.gropn(iws)

      CALL grfrm



      NumRu::DCL.grstrn(itr)

      NumRu::DCL.grswnd(uxmin,uxmax,uymin,uymax)

      NumRu::DCL.usspnt(x,y)

      CALL uspfit



      CALL grstrf

      ........

      NumRu::DCL.sgplu(upx,upy)

      ........

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