0001 function errobar_plus(x,y,e,prop,dir)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 if exist('prop')
0022 color_list='bgrcmyk';
0023 mark_list='.ox+*sdv^<>ph';
0024 color='b';
0025 for j=1:numel(prop)
0026 for i=1:numel(color_list)
0027 if prop(j)==color_list(i)
0028 color=color_list(i);
0029 break
0030 end
0031 end
0032 if prop(j)==color_list(i)
0033 break
0034 end
0035 end
0036 mark='i';
0037 for j=1:numel(prop)
0038 for i=1:numel(mark_list)
0039 if prop(j)==mark_list(i)
0040 mark=mark_list(i);
0041 break
0042 end
0043 end
0044 if prop(j)==mark_list(i)
0045 break
0046 end
0047 end
0048 else
0049 color='b';
0050 mark='i';
0051 end
0052 if (exist('dir')==1) & (dir ~= 'v') & (dir ~= 'h')
0053 dir = 'v';
0054 elseif exist('dir')==5
0055 dir = 'v';
0056 end
0057 dx=(x(1)-x(end))/numel(x)/12;
0058 dy=(y(1)-y(end))/numel(y)/12;
0059 hold on
0060 for i=1:numel(x)
0061 if dir == 'v'
0062 plot([x(i) x(i)], [y(i)-e(i) y(i)+e(i)],color)
0063 switch lower(mark)
0064 case 'i'
0065 plot([x(i)-dx x(i)+dx], [y(i)-e(i) y(i)-e(i)],color)
0066 plot([x(i)-dx x(i)+dx], [y(i)+e(i) y(i)+e(i)],color)
0067 case '^'
0068 plot(x(i), y(i)-e(i),[color,'v'])
0069 plot(x(i), y(i)+e(i),[color,'^'])
0070 case 'v'
0071 plot(x(i), y(i)-e(i),[color,'^'])
0072 plot(x(i), y(i)+e(i),[color,'v'])
0073 otherwise
0074 plot([x(i) x(i)], [y(i)-e(i) y(i)+e(i)],[color,mark])
0075 end
0076 else
0077 plot([x(i)-e(i) x(i)+e(i)], [y(i) y(i)],color)
0078 switch lower(mark)
0079 case 'i'
0080 plot([x(i)-e(i) x(i)-e(i)], [y(i)-dy y(i)+dy],color)
0081 plot([x(i)+e(i) x(i)+e(i)], [y(i)-dy y(i)+dy],color)
0082 case '<'
0083 plot(x(i)-e(i), y(i),[color,'<'])
0084 plot(x(i)+e(i), y(i),[color,'>'])
0085 case '>'
0086 plot(x(i)-e(i), y(i),[color,'>'])
0087 plot(x(i)+e(i), y(i),[color,'<'])
0088 otherwise
0089 plot([x(i)-e(i) x(i)+e(i)], [y(i) y(i)],[color,mark])
0090 end
0091 end
0092 end
0093 hold off