
proc vpost_plot {title geom xtitle ytitles spec \
                        {done_func ""} {zoom_func ""} {ylog 0}} {
   global oned_data anno_data

    if {$oned_data(win_list) == ""} {
	setup_oned_mg
	
	update_oned_mg new_win $title
	set wid $oned_data(wid)
	if {$geom != ""} {
	    top_geometry .[lindex [split $wid .] 1] $geom
	}
	OneDWin::create_axis $xtitle
	if $ylog {
	    set oned_data(y_log) $ylog
	    OneDWin::modify_axis log y
	} 
	
	OneDWin::create_leg
	
	set oned_data($wid,done_func) $done_func
	set oned_data($wid,zoom_func) $zoom_func
    }
    
   foreach yt $ytitles dd $spec {
       eval OneDWin::create_plots set_xydata \{$yt\} [eval concat $dd]
   }

}

if {![info exist tool_id] || ($tool_id != "visual3p")} {
proc start_mg_top {w {map 1} {title ""} {dismiss_proc ""}} {
   global env

   if [winfo exist $w] {
      top_deiconify $w
      top_raise $w
      return ""
   }

   if {[lsearch [package names] BWidget] < 0} {
      error "vpost needs BWidget package"
      mess "vpost needs BWidget package!" red
      return ""
   }

   set map1 $map
   if {$map1 > 0} {set map1 1}
   top_window $w $map1 $title $dismiss_proc
   if {$map == 2} {
      top_lower $w
   } else {
      top_raise $w
   }

   frame $w.top
   set mb [frame $w.top.f -relief raised -bd 0]
   set bb [frame $w.top.b -relief flat -bd 0]
   pack $mb -side left
   pack $bb -side right

   frame $w.m
   set notebook [NoteBook $w.m.nb]
   pack $notebook -fill both -expand yes -padx 1 -pady 1

   pack $w.top -side top  -fill x
   pack $w.m   -side bottom -fill both -expand 1

   return "$mb $bb $notebook"
}
}
