Home > vbmeg > functions > plotfunc > subdirectory > vb_plot_sensor_2d_head_plot_add.m

vb_plot_sensor_2d_head_plot_add

PURPOSE ^

delete previous plot face line

SYNOPSIS ^

function vb_plot_sensor_2d_head_plot_add(vb_plot_sensor_2d_axes_h)

DESCRIPTION ^

 delete previous plot face line

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vb_plot_sensor_2d_head_plot_add(vb_plot_sensor_2d_axes_h)
0002 
0003 % delete previous plot face line
0004 face_handles = getappdata(vb_plot_sensor_2d_axes_h, 'face_handles');
0005 if ~isempty(face_handles)
0006     for k=1:length(face_handles)
0007         try
0008             delete(face_handles(k));
0009         catch
0010         end
0011     end
0012     face_handles = [];
0013 end
0014 
0015 % get contourmap data
0016 children = get(vb_plot_sensor_2d_axes_h, 'children');
0017 if vb_matlab_version('<', '8.4')
0018     group    = findobj(children, 'Type', 'hggroup');
0019     hg       = group(1);
0020 else
0021     hg       = children(end);
0022 end
0023 
0024 Xdata = get(hg, 'Xdata');
0025 Ydata = get(hg, 'Ydata');
0026 Xmin = min(min(Xdata));
0027 Ymin = min(min(Ydata));
0028 Xmax = max(max(Xdata));
0029 Ymax = max(max(Ydata));
0030 rmax = (Ymax - Ymin)/2;
0031 
0032 % cited codes from topoplot.m(EEGLAB) and modified. Thank you.
0033 l = 0:2*pi/100:2*pi;
0034 tip = rmax*1.15; base = rmax-0.04;
0035 EarX = [.497 .510 .518 .5299 .5419 .54 .547 .532 .510 .489]/0.5*rmax;
0036 EarY = [.0555 .0775 .0783 .0746 .0555 -.0055 -.0932 -.1313 -.1384 -.1199]/0.5*rmax;
0037 HCOLOR = [0 0 0];
0038 HLINEWIDTH = 2;
0039 % Plot Head, Ears, Nose
0040 h1 = plot(vb_plot_sensor_2d_axes_h, cos(l).*rmax,sin(l).*rmax,...
0041           'color',HCOLOR,'Linestyle','-','LineWidth',HLINEWIDTH);
0042 
0043 h2 = plot(vb_plot_sensor_2d_axes_h, [.1*rmax/0.5;0;-.1*rmax/0.5],-1*[base;tip;base],...
0044            'Color',HCOLOR,'LineWidth',HLINEWIDTH);
0045 
0046 h3 = plot(vb_plot_sensor_2d_axes_h, EarX,EarY,'color',HCOLOR,'LineWidth',HLINEWIDTH);
0047 h4 = plot(vb_plot_sensor_2d_axes_h,-EarX,EarY,'color',HCOLOR,'LineWidth',HLINEWIDTH);  
0048 xlim([Xmax*-1.2 Xmax*1.2]); ylim([Ymax*-1.2 Ymax*1.2]);
0049 
0050 face_handles = [h1,h2,h3,h4];
0051 set(face_handles, 'HandleVisibility', 'off');
0052 setappdata(vb_plot_sensor_2d_axes_h, 'face_handles', face_handles);
0053

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005