PRO Load_Plot, name, x,y,q,dxLeft,dyUp, dxRight, dyDown, len

;+
; NAME:
; 	Load_Plot
; PURPOSE:
;	Loading into variables a plot stored in the plot table.
; CATEGORY:
;	Data Management
; CALLING SEQUENCE:
;	Load_Plot, name [ ,x, y [, qualifier [, dx, dy ] ] ]
; INPUT:
;	name: the name of the plot
; OUTPUTS:
;	x, y : the points to be plotted
;	qualifier: the symbol number with which the points should
;		be plotted
;	dx, dy: the error of the points in x or y direction.
; COMMON BLOCK:
;	Data, opaque, for access to the plot table
;-
; MODIFICATION HISTORY
;	Created in July 1991 by A.Csillaghy

COMMON Data, list, table

index = Search_Plot( name )
IF index EQ -1 THEN BEGIN
  Print, 'Sorry, no plots with this name is in the table ... '
  Print, ''
  RETURN
ENDIF

p = list( index )
IF p.x EQ 0 THEN BEGIN
  y = table(*, p.y ) & x = IndGen(N_Elements(y))
ENDIF ELSE IF p.y EQ 0 THEN BEGIN
  x = table(*, p.x ) & y = IndGen(N_Elements(x))
ENDIF ELSE BEGIN
  x = table( *,p.x) & y = table( *,p.y)
ENDELSE

IF p.qual EQ 0 THEN q = 0*x + !psym ELSE q = table(*,p.qual)
IF p.dxLeft EQ 0 THEN dxLeft = 0*x ELSE dxLeft = table(*,p.dxLeft)
IF p.dxRight EQ 0 THEN dxRight = 0*x ELSE $
	dxRight = table(*,p.dxRight)
IF p.dyUp EQ 0 THEN dyUp = 0*y ELSE dyUp = table(*,p.dyUp)
IF p.dyDown EQ 0 THEN dyDown = 0*y ELSE $
	dyDown = table(*,p.dyDown)

len = p.len

END