pro Graff_init, pdefs, file, version=version ;+ ; GRAFF_INIT ; Set up a new graffer plot structure ; ; Usage: ; graff_init, pdefs ; ; Argument: ; pdefs struct output The graffer plot structure. ; file string input The filename for the new plot. ; ; Keywords: ; version int input The graffer version 2-elements, major ; & minor version numbers, if pdefs exists, ; then previous version is retained. ; ; Note: ; If pdefs exists, it is assumed to be a pre-existing pdefs ; structure and its associated handles are released. ; ; History: ; Extracted from GRAFFER: 18/8/95; SJT ;- if (n_elements(pdefs) ne 0) then begin version = pdefs.version idblock = pdefs.ids hblock = pdefs.hardset topid = pdefs.ids.graffer graff_clear, pdefs dir = pdefs.dir end if (n_elements(file) eq 0) then begin fc = '' if (n_elements(dir) eq 0) then cd, curr = dir endif else begin fc = file split_dir, fc, dir endelse pdefs = {graff_define, $ Version: version, $ Name: fc, $ Dir: dir, $ Title: '', $ Subtitle: '', $ Charsize: 1.0, $ Axthick: 1, $ Xrange: findgen(2), $ Xtitle: '', $ Xtype: 0, $ Xsty: 0, $ Yrange: findgen(2), $ Ytitle: '', $ Ytype: 0, $ Ysty: 0, $ Nsets: 1, $ Cset: 0, $ Data: handle_create(), $ Ntext: 0, $ Text: handle_create(), $ Ids: { graff_ids, $ Graffer: 0l, $ Name: 0l, $ Dir: 0l, $ Title: 0l, $ Subtitle:0l, $ Charsize:0l, $ Axthick: 0l, $ Xtitle: 0l, $ Xmin: 0l, $ Xmax: 0l, $ Xlog: 0l, $ Ytitle: 0l, $ Ymin: 0l, $ Ymax: 0l, $ Ylog: 0l, $ Cset: 0l, $ Psym: 0l, $ Symsize: 0l, $ Colour: 0l, $ Line: 0l, $ Thick: 0l, $ Sort: 0l, $ Xcp: 0l, $ Ycp: 0l, $ Draw: 0l, $ Message: 0l, $ Hlptxt: 0l $ }, $ Hardset: { graff_hard, $ Colour: 0b, $ Eps: 0b, $ Orient: 0b, $ Size: replicate(15., 2), $ Action: ['lp ', ''], $ Timestamp: 0b $ }, $ Transient: { graff_trans, $ Imove: -1l, $ Opos: fltarr(2), $ Opflag: 0b, $ Changes: 0 $ }, $ Chflag: 0b $ } if (n_elements(idblock) ne 0) then pdefs.ids = idblock if (n_elements(hblock) ne 0) then pdefs.hardset = hblock data_str = {graff_data, $ Ndata: 0, $ $ Type: 0, $ Xydata: handle_create(), $ Descript: "", $ Psym: 0, $ Symsize: 1., $ Line: 0, $ Colour: 1, $ Thick: 1, $ Sort: 0b} handle_value, data_str.xydata, fltarr(2, 2), /set handle_value, pdefs.data, data_str, /set, /no_copy handle_value, pdefs.text, {graff_text, $ Text: '', $ Colour: 1, $ Size: 1.0, $ Orient: 0., $ Align: 0., $ Font: 3, $ Thick: 1, $ X: 0., $ Y: 0., $ Norm: 0b}, /set end