PRO Deriv_Plot

;+
; NAME
; 	 Deriv_Plot
; PURPOSE
;	Computes the derivative of the plot, which should be
; 	a bijective function of x. This procedure
;	is a part of the mdisp analyser.
; CATEGORY:
;	1D
; CALLING SEQUENCE:
;	Deriv_Plot
; COMMON BLOCK:
;	DerivRetr: for intern use only
; SIDE EFFECTS:
;	The Selectioner from mdisp is used, and a new plot is
;	created.
; RESTRICTION:
;	To use ONLY together with the mdisp selectioner.
;	For normal vectors, use "Deriv"
; -
; MODIFICATION HISTORY
;	Created: June 91, A.Csillaghy

COMMON DerivRetr, derivNr

IF N_Elements(derivNr) EQ 0 THEN derivNr= 0

nbSelected = N_Selected()

FOR i = 1, nbSelected DO BEGIN
  name = Selection(i)
  Load_Plot, name, x,y
  newY = Deriv( x, y )
  newName = name + '_de'+StrTrim(derivNr,2)
  derivNr = derivNr +1 
  Store_Plot, newName, x,newY
  Remove_Sel, name
  Insert_Sel, newName
ENDFOR

END