Specifying the View Surface

The first thing that a graphics program must do is to tell PLPLOT which device it is going to use, and how this device is to be divided up for graph plotting. There are two routines that do this, <#1044#>plstar<#1044#> (page #plstar#1045>), which prompts at the console for the output device type and <#1046#>plbeg<#1046#> (page #plbeg#1047>), which expects to be supplied the code number of the device as an argument. The code numbers required by <#826#>plbeg<#826#> are the same as displayed by <#827#>plstar<#827#> when it prompts for a device.

Besides selecting the device, <#828#>plstar<#828#> and <#829#>plbeg<#829#> allow the user to divide the output device plotting area into several subpages of equal size, each of which can be used separately. The routine <#830#>pladv<#830#> is used to advance to a particular subpage or to the next subpage. The screen is cleared (after waiting for the user to select Continue from the Graphics Control menu or hit the RETURN key), or a new piece of paper is loaded, if a new subpage is requested when there are no subpages left on the current page. When a page is divided into subpages, the default character, symbol and tick sizes are scaled inversely as the square root of the number of subpages in the vertical direction.

At the end of a plotting program, it is important to close the plotting device by calling <#1048#>plend<#1048#> (page #plend#1049>). This flushes any internal buffers and frees any memory that may have been allocated. Note that if <#832#>plstar<#832#> or <#833#>plbeg<#833#> is called more than once during a program to change the output device, an automatic call to <#834#>plend<#834#> is made before the new device is opened.