pro tplot_options,string,value $
,datanames=datanames $
,var_label=var_label $
,version=version $
,verbose=verbose $
,title = title $
,refdate = refdate $
,full_trange = tr_full $
,wshow = wshow $
,trange = tr $
,options = opts $
,get_options = get_opts $
,help=help $
,window = wind
@tplot_com
if n_elements(opts) ne 0 then str_element,tplot_vars,'options',opts, /add_replace
str_element,tplot_vars,'options',tplot_opts
if size(/type,tplot_opts) ne 8 then str_element,tplot_vars,'options',0,/add_replace
if size(/type,string) eq 7 then str_element,tplot_vars,'options.'+string,value,/add_replace
if size(/type,datanames) eq 7 then str_element,tplot_vars,'options.datanames',datanames,/add_replace
if not keyword_set(tplot_vars) then begin
options ={datanames:'',varnames:'',trange_full:dblarr(2),trange:dblarr(2)}
settings={varnames:'',trange_old:dblarr(2),trange_cur:dblarr(2)}
tplot_vars= {options:options,settings:settings}
endif
if n_elements(title) ne 0 then str_element,tplot_vars,'options.title',title,/add_replace
if n_elements(var_label) ne 0 then str_element,tplot_vars,'options.var_label',var_label,/add_replace
if n_elements(version) ne 0 then str_element,tplot_vars,'options.version',version,/add_replace
if n_elements(verbose) ne 0 then str_element,tplot_vars,'options.verbose',verbose,/add_replace
if n_elements(refdate) ne 0 then str_element,tplot_vars,'options.refdate',strmid(time_string(refdate),0,10),/add_replace
if n_elements(wshow) ne 0 then str_element,tplot_vars,'options.wshow',wshow,/add_replace
if n_elements(tr) ne 0 then str_element,tplot_vars,'options.trange',tr,/add_replace
if n_elements(tr_full) ne 0 then str_element,tplot_vars,'options.trange_full',tr_full,/add_replace
if n_elements(wind) ne 0 then str_element,tplot_vars,'options.window',wind,/add_replace
str_element,tplot_vars,'options.trange_full',t_f
if n_elements(t_f) eq 0 then str_element,tplot_vars,'options.trange_full',double([0.,0.]),/add_replace
str_element,tplot_vars,'settings.trange_old',t_o
if n_elements(t_o) eq 0 then str_element,tplot_vars,'settings.trange_old',tplot_vars.options.trange_full,/add_replace
str_element,tplot_vars,'options.trange',t_r
if n_elements(t_r) eq 0 then str_element,tplot_vars,'options.trange',tplot_vars.settings.trange_old,/add_replace
if keyword_set(help) then begin
help,/st,tplot_vars.options
endif
get_opts = tplot_vars.options
end