;+ ; This procedure sets the units on the X-axis of the plot ; Valid units are 'Channels','Hz'.'kHz','MHz', 'GHz', 'm/s', and 'km/s' ; ; @param unit {in}{required}{type=string} unit ; ; @examples ;
; get,index=1 ; show ; setxunit,'MHz' ;; ; @version $Id: setxunit.pro,v 1.6 2005/05/30 04:03:43 bgarwood Exp $ ;- pro setxunit, unit common gbtplot_common,mystate,xarray if n_elements(unit) eq 0 then begin message,'Usage: setxunit, unit',/info message,' unit must be one of "Channels","Hz","kHz","MHz",',/info message,' "GHz","m/s",or "km/s"',/info return endif if (data_valid(*mystate.dc_ptr) le 0) then begin ; nothing has been plotted, just set it and return parsexunit, unit, scale, type mystate.xunit = unit mystate.xscale = scale mystate.xtype = type !g.plotter_axis_type = mystate.xtype endif else begin if (mystate.xunit ne unit) then begin convertxstate, unit, mystate.frame, mystate.veldef, mystate.absrel, mystate.voffset show,/reshow endif endelse widget_control,mystate.xunits_id,set_value=unit end