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, plstar, which prompts at the console for the output device type and plbeg, which expects to be supplied the code number of the device as an argument. The code numbers required by plbeg are the same as displayed by plstar when it prompts for a device.
Besides selecting the device, plstar and plbeg 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 pladv 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 plend. This flushes any internal buffers and frees any memory that may have been allocated. Note that if plstar or plbeg is called more than once during a program to change the output device, an automatic call to plend is made before the new device is opened.