Home > functions > gui > vb_select_xyrange.m

vb_select_xyrange

PURPOSE ^

vb_select_xyrange( key, varargin )

SYNOPSIS ^

function varargout = vb_select_xyrange(key, varargin)

DESCRIPTION ^

 vb_select_xyrange( key, varargin )

  2次元グラフのxy軸の範囲をマウスドラッグで指定するための
  コールバックルーチンです

 key :  'init'  'delete'  'get'  'clear'  'SetBoxColor'
        'SetReturnVariable'  'SetButtonUpFcn'  'SetInitialRange'

   vb_select_xyrange( 'init', <axes handle>
       [ , 'BoxColor', <color> ]
       [ , 'ReturnVariable', <variable name> ]
       [ , 'ButtonUpFcn', <function string> ]
       [ , 'InitialRange', <range> ] )
     <axes handle> で指定されるグラフを選択対象に設定します。オプ
     ションとして、'BoxColor', 'BoxStyle',
     'ReturnVariable', 'ButtonUpFcn', 'InitialRange' を設定できま
     す。それぞれのオプションの詳細は下記を参照してください。

   vb_select_xyrange( 'delete', <axes handle> )
     <axes handle> で指定されるグラフを選択対象から除外します。

   vb_select_xyrange( 'get', <axes handle> )
     <axes handle> で指定されるグラフをにおける現在の選択範囲を返
     します。出力形式は [ x下界値, y下界値, x上界値, y上界値 ] です。

   vb_select_xyrange( 'clear', <axes handle> )
     <axes handle> で指定されるグラフの選択範囲を消去します。
   
   vb_select_xyrange( 'SetBoxColor', <axes handle>, <color> );
     <axes handle> で指定されるグラフにおける選択範囲を示すBOXの色
     を設定します。<color>はMatlabのColorSpecに準拠します。デフォ
     ルト値は [ 1.0, 0.6, 0.6 ] です。

   vb_select_xyrange( 'SetReturnVariable', <axes_handle>, <variable name> );
     <axes handle> で指定されるグラフにおける選択範囲を出力するた
     めのグローバル変数名を設定します。<variable name> は変数名を
     示す文字列になります。デフォルトは空行列です。

   vb_select_xyrange( 'SetButtonUpFcn', <axes_handle>, <command> );
     <axes handle> で指定されるグラフにおけるドラッグ終了時に実行
     するコマンドを設定します。ここで、選択した範囲を利用するには、
     xyrange という変数名を用いて下さい。例えば、
       >> vb_select_xyrange( 'SetButtonUpFcn', 'func( xyrange, var )' );
     などにより、選択範囲が関数funcの引数として渡されます。デフォ
     ルトは空行列です。

   vb_select_xyrange( 'SetInitialRange', <range> );
     <axes handle> で指定されるグラフにおける選択範囲の初期値を設
     定します。これを用いることにより、マウスドラッグ以外での範囲
     指定が可能です。<range>は4要素のベクトルで、引数形式は 
     [ x下界値, y下界値, x上界値, y上界値 ] です。
     マウスドラッグでは、表示グラフより大きい範囲指定はできませんが、こ
     こでは可能です。デフォルトは空行列です。


 [ 簡単な使い方の説明 ]

   まず、選択対象となるグラフの axes handle を設定します。

   >> vb_select_xyrange( 'set', <axes handle> );

   これにより、対象グラフをマウスでドラッグすると
   選択されたx軸範囲が四角形で囲まれます。
   選択範囲にアクセスするには、

   >> vb_select_xyrange( 'get', <axes handle> );

   としてください。


 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function varargout = vb_select_xyrange(key, varargin)
0002 % vb_select_xyrange( key, varargin )
0003 %
0004 %  2次元グラフのxy軸の範囲をマウスドラッグで指定するための
0005 %  コールバックルーチンです
0006 %
0007 % key :  'init'  'delete'  'get'  'clear'  'SetBoxColor'
0008 %        'SetReturnVariable'  'SetButtonUpFcn'  'SetInitialRange'
0009 %
0010 %   vb_select_xyrange( 'init', <axes handle>
0011 %       [ , 'BoxColor', <color> ]
0012 %       [ , 'ReturnVariable', <variable name> ]
0013 %       [ , 'ButtonUpFcn', <function string> ]
0014 %       [ , 'InitialRange', <range> ] )
0015 %     <axes handle> で指定されるグラフを選択対象に設定します。オプ
0016 %     ションとして、'BoxColor', 'BoxStyle',
0017 %     'ReturnVariable', 'ButtonUpFcn', 'InitialRange' を設定できま
0018 %     す。それぞれのオプションの詳細は下記を参照してください。
0019 %
0020 %   vb_select_xyrange( 'delete', <axes handle> )
0021 %     <axes handle> で指定されるグラフを選択対象から除外します。
0022 %
0023 %   vb_select_xyrange( 'get', <axes handle> )
0024 %     <axes handle> で指定されるグラフをにおける現在の選択範囲を返
0025 %     します。出力形式は [ x下界値, y下界値, x上界値, y上界値 ] です。
0026 %
0027 %   vb_select_xyrange( 'clear', <axes handle> )
0028 %     <axes handle> で指定されるグラフの選択範囲を消去します。
0029 %
0030 %   vb_select_xyrange( 'SetBoxColor', <axes handle>, <color> );
0031 %     <axes handle> で指定されるグラフにおける選択範囲を示すBOXの色
0032 %     を設定します。<color>はMatlabのColorSpecに準拠します。デフォ
0033 %     ルト値は [ 1.0, 0.6, 0.6 ] です。
0034 %
0035 %   vb_select_xyrange( 'SetReturnVariable', <axes_handle>, <variable name> );
0036 %     <axes handle> で指定されるグラフにおける選択範囲を出力するた
0037 %     めのグローバル変数名を設定します。<variable name> は変数名を
0038 %     示す文字列になります。デフォルトは空行列です。
0039 %
0040 %   vb_select_xyrange( 'SetButtonUpFcn', <axes_handle>, <command> );
0041 %     <axes handle> で指定されるグラフにおけるドラッグ終了時に実行
0042 %     するコマンドを設定します。ここで、選択した範囲を利用するには、
0043 %     xyrange という変数名を用いて下さい。例えば、
0044 %       >> vb_select_xyrange( 'SetButtonUpFcn', 'func( xyrange, var )' );
0045 %     などにより、選択範囲が関数funcの引数として渡されます。デフォ
0046 %     ルトは空行列です。
0047 %
0048 %   vb_select_xyrange( 'SetInitialRange', <range> );
0049 %     <axes handle> で指定されるグラフにおける選択範囲の初期値を設
0050 %     定します。これを用いることにより、マウスドラッグ以外での範囲
0051 %     指定が可能です。<range>は4要素のベクトルで、引数形式は
0052 %     [ x下界値, y下界値, x上界値, y上界値 ] です。
0053 %     マウスドラッグでは、表示グラフより大きい範囲指定はできませんが、こ
0054 %     こでは可能です。デフォルトは空行列です。
0055 %
0056 %
0057 % [ 簡単な使い方の説明 ]
0058 %
0059 %   まず、選択対象となるグラフの axes handle を設定します。
0060 %
0061 %   >> vb_select_xyrange( 'set', <axes handle> );
0062 %
0063 %   これにより、対象グラフをマウスでドラッグすると
0064 %   選択されたx軸範囲が四角形で囲まれます。
0065 %   選択範囲にアクセスするには、
0066 %
0067 %   >> vb_select_xyrange( 'get', <axes handle> );
0068 %
0069 %   としてください。
0070 %
0071 %
0072 % Copyright (C) 2011, ATR All Rights Reserved.
0073 % License : New BSD License(see VBMEG_LICENSE.txt)
0074 
0075 
0076 
0077 const = vb_define_verbose;
0078 VERBOSE_LEVEL_DEBUG = const.VERBOSE_LEVEL_DEBUG;
0079 
0080 switch key
0081 
0082  % -----------------------------------------------------------------
0083  %  key : init
0084  % -----------------------------------------------------------------
0085  case 'init'  % axes を vb_select_xyrange の対象として設定
0086 
0087   % object handle 取得
0088   h = varargin{1};
0089   if ~ishandle(h), % | ~strcmp( get(h,'Type'), 'axes' )
0090     disp( 'error in vb_select_xyrange: invalid object handle' );
0091     return;
0092   end
0093   
0094   % Set hh to axes handle of parent of the object specified by
0095   % given handle
0096   hh = h;
0097   while true
0098     if strcmp(get(hh,'Type'),'axes'), break; end
0099     hh = get(hh,'Parent');
0100   end
0101 
0102   % 引数チェック(不完全)  %%%
0103   if mod( size(varargin,2), 2 ) ~= 1
0104     disp( 'invalid arguments for vb_select_xyrange( ''set'', ... )' );
0105     return;
0106   end 
0107   i = 2;
0108   while i < size(varargin,2)
0109     switch varargin{i}
0110      case 'BoxColor'
0111       boxcolor = varargin{i+1};
0112      case 'ReturnVariable'
0113       retvar = varargin{i+1};
0114      case 'ButtonUpFcn'
0115       upfcn = varargin{i+1};
0116      case 'InitialRange'
0117       xyrange = varargin{i+1};
0118      otherwise
0119       disp( 'invalid arguments for vb_select_xyrange( ''set'', ... )' );
0120       return;
0121     end
0122     i = i + 2;
0123   end
0124   % ---- 引数チェック終了
0125   
0126   % オプションのデフォルト設定
0127   if ~exist('boxcolor'); boxcolor = [0.6,0.6,0.6]; end
0128   if ~exist('retvar'); retvar = []; end
0129   if ~exist('upfcn'); upfcn = []; end
0130   if ~exist('xyrange'); xyrange = []; end
0131   
0132   % object に マウスボタンを押したときのコールバックを設定
0133   set( h, 'ButtonDownFcn',...
0134       [ 'vb_select_xyrange(''down'',''' retvar ''',''' upfcn ''');' ] );
0135   
0136   % 既存の範囲選択BOXがあれば削除
0137   boxhandle = findobj( hh, 'Tag', 'SelX_BOX' );
0138   if ~isempty( boxhandle );
0139     delete( boxhandle );
0140   end
0141   
0142   boxhandle = findobj( hh, 'Tag', 'SelXY_BOX' );
0143   if ~isempty( boxhandle );
0144     delete( boxhandle );
0145   end
0146   
0147   % 新規に範囲選択BOXを作成
0148   if isempty(xyrange)
0149     xlim = get( hh, 'XLim' );
0150     ylim = get( hh, 'YLim' );
0151     xinf = xlim(1);
0152     xsup = xlim(2);
0153     yinf = ylim(1);
0154     ysup = ylim(2);
0155   else
0156     xinf = xyrange(1);
0157     xsup = xyrange(3);
0158     yinf = xyrange(2);
0159     ysup = xyrange(4);
0160   end
0161   
0162   axes(hh);
0163   boxhandle = ...
0164       patch( [ xinf, xsup, xsup, xinf ],...
0165          [ yinf, yinf, ysup, ysup ], ...
0166          boxcolor, 'HitTest', 'off', 'Visible', 'off',...
0167          'Tag', 'SelXY_BOX' , ...
0168              'FaceColor', 'none', 'LineWidth', 2.5);
0169   if ~isempty(xyrange)
0170     set( boxhandle, 'Visible', 'on' );
0171   end
0172   % -----
0173 
0174 
0175 
0176  % -----------------------------------------------------------------
0177  %  key : delete
0178  % -----------------------------------------------------------------
0179  case 'delete'  % object を vb_select_xyrange の対象から削除
0180   
0181   % object handle 取得
0182   h = varargin{1};
0183   if ~ishandle(h), % | ~strcmp( get(h,'Type'), 'axes' )
0184     disp( 'error in vb_select_xyrange: invalid object handle' );
0185     return;
0186   end
0187   
0188   % Set hh to axes handle of parent of the object specified by
0189   % given handle
0190   hh = h;
0191   while true
0192     if strcmp(get(hh,'Type'),'axes'), break; end
0193     hh = get(hh,'Parent');
0194   end
0195 
0196   % 範囲選択BOXがあれば削除 (BOXは'init'時に必ず作成される)
0197   boxhandle = findobj( hh, 'Tag', 'SelX_BOX' );
0198   if ~isempty( boxhandle );
0199     delete( boxhandle );
0200     set( h, 'ButtonDownFcn', [] );
0201   end
0202   
0203   boxhandle = findobj( hh, 'Tag', 'SelXY_BOX' );
0204   if ~isempty( boxhandle );
0205     delete( boxhandle );
0206     set( h, 'ButtonDownFcn', [] );
0207   end
0208 
0209 
0210 
0211  % -----------------------------------------------------------------
0212  %  key : down
0213  % -----------------------------------------------------------------
0214  case 'down' % マウスボタンが押されたとき (Boxの描画,
0215              % WindowButtonMotionFcn, WindowButtonUpFcn の設定)
0216 
0217   % 引数 : retvar --- 出力用グローバル変数,
0218   %        upfcn --- マウスボタンを離したときのコマンド
0219   retvar = varargin{1};
0220   upfcn = varargin{2};
0221   
0222   % Debug code
0223   if vb_get_verbose==VERBOSE_LEVEL_DEBUG, 
0224     disp('vb_select_xyrange(''down'') invoked');
0225     fprintf('upfcn=%s\n',upfcn);
0226   end
0227 
0228   % 有効なのは左クリックのみ
0229   if strcmp( get( gcf, 'SelectionType' ), 'normal' ) == 0
0230     return;
0231   end
0232   
0233   % BOXの再描画
0234   acpt = get( gca, 'CurrentPoint' );  
0235   xlim = get( gca, 'XLim' );
0236   ylim = get( gca, 'YLim' );
0237   xini = max( xlim(1), acpt(1) ); % 範囲選択は
0238   xini = min( xlim(2), xini );    % グラフのaxis内のみ
0239   yini = max( ylim(1), acpt(3) ); % 範囲選択は
0240   yini = min( ylim(2), yini );    % グラフのaxis内のみ
0241   boxhandle = findobj( gca, 'Tag', 'SelXY_BOX' ); % BOXのハンドルを取得
0242   set( boxhandle, 'XData', [ xini, xini, xini, xini ],...
0243           'YData', [ yini, yini, yini, yini ],...
0244                   'Visible', 'on' );
0245   
0246   % マウスを動かしたときとボタンを離したときのコールバックを設定
0247   set( gcf, 'WindowButtonMotionFcn', 'vb_select_xyrange(''move'')' );
0248   if isempty( retvar )
0249     set( gcf, 'WindowButtonUpFcn',...
0250           [ 'vb_select_xyrange(''up'',''' upfcn ''');' ] );
0251   else
0252     set( gcf, 'WindowButtonUpFcn',...
0253           [ retvar ' = vb_select_xyrange(''up'',''' upfcn ''');' ] );
0254   end
0255   
0256  
0257 
0258  % -----------------------------------------------------------------
0259  %  key : move
0260  % -----------------------------------------------------------------
0261  case 'move' % マウスを動かしたとき
0262 
0263   % BOXの再描画
0264   acpt = get( gca, 'CurrentPoint' );
0265   xlim = get( gca, 'XLim' );
0266   ylim = get( gca, 'YLim' );
0267   xcur = max( xlim(1), acpt(1) ); % 範囲選択は
0268   xcur = min( xlim(2), xcur );    % グラフのaxis内のみ
0269   ycur = max( ylim(1), acpt(3) ); % 範囲選択は
0270   ycur = min( ylim(2), ycur );    % グラフのaxis内のみ
0271   boxhandle = findobj( gca, 'Tag', 'SelXY_BOX' ); % BOXのハンドルを取得
0272   temp = get( boxhandle, 'XData' );
0273   xini = temp(1);
0274   set( boxhandle, 'XData', [ xini, xcur, xcur, xini ] );
0275   temp = get( boxhandle, 'YData' );
0276   yini = temp(1);
0277   set( boxhandle, 'YData', [ yini, yini, ycur, ycur ] );
0278   
0279   % Debug code
0280   if vb_get_verbose==VERBOSE_LEVEL_DEBUG, 
0281     disp('vb_select_xyrange(''move'') invoked');
0282     fprintf('xyrange=[%f %f %f %f]\n',xini,xcur,yini,ycur);
0283   end
0284 
0285  % -----------------------------------------------------------------
0286  %  key : up
0287  % -----------------------------------------------------------------
0288  case 'up' % マウスボタンを離したとき
0289 
0290   % 引数 : upfcn --- マウスボタンを離したときのコマンド
0291   upfcn = varargin{1};
0292   
0293   % マウスを動かしたときとマウスボタンを離したときのコールバックの解除
0294   set( gcf, 'WindowButtonMotionFcn', [] );
0295   set( gcf, 'WindowButtonUpFcn', [] );
0296   
0297   % BOXの再描画
0298   acpt = get( gca, 'CurrentPoint' );
0299   xlim = get( gca, 'XLim' );
0300   ylim = get( gca, 'YLim' );
0301   xcur = max( xlim(1), acpt(1) );
0302   xcur = min( xlim(2), xcur );
0303   ycur = max( ylim(1), acpt(3) );
0304   ycur = min( ylim(2), ycur );
0305   boxhandle = findobj( gca, 'Tag', 'SelXY_BOX' );
0306   temp = get( boxhandle, 'XData' );
0307   xini = temp(1);
0308   set( boxhandle, 'XData', [ xini, xcur, xcur, xini ] );
0309   temp = get( boxhandle, 'YData' );
0310   yini = temp(1);
0311   set( boxhandle, 'YData', [ yini, yini, ycur, ycur ] );
0312   
0313   % 選択範囲
0314   xrange = sort( [ xini, xcur ] );
0315   yrange = sort( [ yini, ycur ] );
0316   xyrange = [xrange(1) yrange(1) xrange(2) yrange(2)];
0317   
0318   % ユーザ指定関数呼び出し
0319   if ~isempty( upfcn )
0320     eval( upfcn );
0321   end
0322   
0323   % 返値として出力
0324   varargout{1} = xyrange;
0325   
0326 
0327  
0328  % -----------------------------------------------------------------
0329  %  key : get
0330  % -----------------------------------------------------------------
0331  case 'get' % 指定範囲の取得
0332   
0333   % object handle 取得
0334   h = varargin{1};
0335   if ~ishandle(h), % | ~strcmp( get(h,'Type'), 'axes' )
0336     disp( 'error in vb_select_xyrange: invalid object handle' );
0337     varargout{1} = [];
0338     return;
0339   end
0340   
0341   % Set hh to axes handle of parent of the object specified by
0342   % given handle
0343   hh = h;
0344   while true
0345     if strcmp(get(hh,'Type'),'axes'), break; end
0346     hh = get(hh,'Parent');
0347   end
0348   
0349   % BOXのハンドルを取得 → あれば出力
0350   boxhandle = findobj( hh, 'Tag', 'SelXY_BOX' );
0351   if ~isempty(boxhandle) &...
0352      strcmp( get( boxhandle, 'Visible' ), 'on' ) == 1;
0353     xdat = get( boxhandle, 'XData' );
0354     ydat = get( boxhandle, 'YData' );
0355     xrange = sort( [ xdat(1), xdat(2) ] );
0356     yrange = sort( [ ydat(1), ydat(3) ] );
0357     xyrange = [xrange(1) yrange(1) xrange(2) yrange(2)];
0358     varargout{1} = xyrange;
0359   else
0360     varargout{1} = [];
0361   end
0362   
0363 
0364 
0365  % -----------------------------------------------------------------
0366  %  key : clear
0367  % -----------------------------------------------------------------
0368  case 'clear'  % BOXの消去
0369   
0370   % object handle 取得
0371   h = varargin{1};
0372   if ~ishandle(h), % | ~strcmp( get(h,'Type'), 'axes' )
0373     disp( 'error in vb_select_xyrange: invalid object handle' );
0374     return;
0375   end
0376   
0377   % Set hh to axes handle of parent of the object specified by
0378   % given handle
0379   hh = h;
0380   while true
0381     if strcmp(get(hh,'Type'),'axes'), break; end
0382     hh = get(hh,'Parent');
0383   end
0384 
0385   % BOXのハンドルを取得 → あれば非可視化
0386   boxhandle = findobj( hh, 'Tag', 'SelXY_BOX' );
0387   if ~isempty(boxhandle)
0388     xlim = get( hh, 'XLim' );
0389     set( boxhandle, 'Visible', 'off' );
0390   end
0391 
0392 
0393 
0394  % -----------------------------------------------------------------
0395  %  key : SetBoxColor
0396  % -----------------------------------------------------------------
0397  case 'SetBoxColor'  % 範囲選択BOXの色を設定 (不完全) %%%
0398   
0399   % object handle 取得
0400   h = varargin{1};
0401   if ~ishandle(h), % | ~strcmp( get(h,'Type'), 'axes' )
0402     disp( 'error in vb_select_xyrange: invalid object handle' );
0403     return;
0404   end
0405   
0406   % Set hh to axes handle of parent of the object specified by
0407   % given handle
0408   hh = h;
0409   while true
0410     if strcmp(get(hh,'Type'),'axes'), break; end
0411     hh = get(hh,'Parent');
0412   end
0413   
0414   % 引数 : 設定する色 (チェック必要)
0415   boxcolor = varargin{2};
0416 
0417   % BOXのハンドルを取得 → あれば色の変更(不完全) %%%
0418   boxhandle = findobj( hh, 'Tag', 'SelXY_BOX' );
0419   if ~isempty(boxhandle)
0420     set( boxhandle, 'FaceVertexCData', boxcolor );
0421   end
0422   
0423 
0424 
0425  % -----------------------------------------------------------------
0426  %  key : SetReturnVariable
0427  % -----------------------------------------------------------------
0428  case 'SetReturnVariable' % ボタンを離したときに選択範囲を出力する
0429                           % ためのグローバル変数の設定
0430 
0431   % object handle 取得
0432   h = varargin{1};
0433   if ~ishandle(h), % | ~strcmp( get(h,'Type'), 'axes' )
0434     disp( 'error in vb_select_xyrange: invalid object handle' );
0435     return;
0436   end
0437   
0438   % 引数 : 設定する変数 (チェック必要?不可能か?) %%%
0439   retvar = varargin{2};
0440 
0441   % axes ButtonDownFcn コールバックの書き直し
0442   bdf = get( h, 'ButtonDownFcn' );
0443   i = findstr( bdf, 'vb_select_xyrange' );
0444   if ~isempty( i )
0445     c = findstr( bdf, ',' );
0446     set( h, 'ButtonDownFcn',...
0447         [ bdf(1:c(1)+1), retvar, bdf(c(2)-1:size(bdf,2)) ] );
0448   end
0449   
0450   
0451 
0452  % -----------------------------------------------------------------
0453  %  key : SetButtonUpFcn
0454  % -----------------------------------------------------------------
0455  case 'SetButtonUpFcn'  % ボタンを離したときに実行されるコマンドの設定
0456 
0457   % object handle 取得
0458   h = varargin{1};
0459   if ~ishandle(h), % | ~strcmp( get(h,'Type'), 'axes' )
0460     disp( 'error in vb_select_xyrange: invalid object handle' );
0461     return;
0462   end
0463 
0464   % 引数 : 設定するコマンド (チェック必要?不可能か?) %%%
0465   upfcn = varargin{2};
0466   
0467   % axes ButtonDownFcn コールバックの書き直し
0468   bdf = get( h, 'ButtonDownFcn' );
0469   i = findstr( bdf, 'vb_select_xyrange' );
0470   if ~isempty( i )
0471     c = findstr( bdf, ',' );
0472     set( h, 'ButtonDownFcn',...
0473         [ bdf(1:c(2)+1), upfcn, ''');' ] );
0474   end
0475 
0476 
0477  % -----------------------------------------------------------------
0478  %  key : SetInitialRange
0479  % -----------------------------------------------------------------
0480  case 'SetInitialRange'  % マウスドラッグ前の選択範囲を設定
0481   
0482   % object handle 取得
0483   h = varargin{1};
0484   if ~ishandle(h), % | ~strcmp( get(h,'Type'), 'axes' )
0485     disp( 'error in vb_select_xyrange: invalid object handle' );
0486     return;
0487   end
0488   
0489   % Set hh to axes handle of parent of the object specified by
0490   % given handle
0491   hh = h;
0492   while true
0493     if strcmp(get(hh,'Type'),'axes'), break; end
0494     hh = get(hh,'Parent');
0495   end
0496   
0497   % 引数 : 設定する範囲 (チェック必要) %%%
0498   xyrange = varargin{2};
0499   
0500   % BOXのハンドル取得 → あれば再描画&可視化
0501   boxhandle = findobj( hh, 'Tag', 'SelXY_BOX' );
0502   if ~isempty(boxhandle)
0503     set( boxhandle, 'XData', [xrange(1),xrange(3),xrange(3),xrange(1)],...
0504                     'YData', [xrange(2),xrange(2),xrange(4),xrange(4)],...
0505             'Visible', 'on');
0506   end
0507 
0508 
0509   
0510  % -----------------------------------------------------------------
0511  %  key : その他 (エラー)
0512  % -----------------------------------------------------------------
0513  otherwise
0514   disp( 'Invalid key for vb_select_xyrange()' );
0515 
0516 
0517   
0518 end % switch key
0519

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005