PyNGL Home > Functions > Workstation routines

Ngl.delete_wks

Deletes a workstation object.

Prototype

Ngl.delete_wks(wks)

Arguments

wks

A workstation identifier returned from calling Ngl.open_wks.

Return value

   None

Description

This function deletes a workstation object that was created using Ngl.open_wks. Calling this function after you are finished drawing to a workstation provides for the sequential opening and deleting of an indefinite number of workstations, thus avoiding any restrictions on the maximum number of simultaneously open workstations of a given type. The limits on the maximum number of simultaneously open workstations are:

   ncgm -  1
   pdf  -  1
   ps   - 15
   x11  - 15

Examples

import Ngl

#
#  Draw a line to two different pdf files created in sequence.  
#  This example would fail without the Ngl.delete_wks call.
#
rlist = Ngl.Resources()
wks_type = "pdf"

for i in xrange(2):
  rlist.wkPDFFileName = "pdf" + str(i)
  wks = Ngl.open_wks(wks_type,"pdf_file",rlist)
  Ngl.polyline_ndc(wks,[0.05,0.95],[0.5,0.5])
  Ngl.frame(wks)
  Ngl.delete_wks(wks)

Ngl.end()