function min_legend(str,colormode,size,fontsize);
global min_legend;
global min_legend_handle;
if ~isempty(min_legend)
    if isempty(min_legend_handle)
        ax1=axes('position',[0.05 0.8 0.01 0.01],'XTick',[],'YTick',[]);
        set(ax1,'FontSize',fontsize);
        cla;
        legend;
        min_legend_handle=ax1;
    else
        ax1=min_legend_handle;
        axes(ax1);
        set(ax1,'Visible','on');
        set(ax1,'FontSize',fontsize);
        cla;
        legend off;
    end
    hold on;
    sectors=[];
    names=[];
    nsectors=0;
    for i=1:length(str)
        exa=find(sectors==str(i).type);
        if (isempty(exa))
            sectors=[sectors,str(i).type];
            nsectors=nsectors+1;
            names{nsectors}=getnamesector(str(i).type);
            color=str(i).color;
            color_bw=str(i).color_bw;
            color_bw1=str(i).color_bw1;
            symvol=str(i).symvol;
            xx=plot(0,0,'ko');
            if colormode==0
                %set(handles.Tmin(i),'markerfacecolor',[0 0 0]);
                %set(handles.Tmin(i),'markerfacecolor','none');
                
                %set(xx,'markerfacecolor',color_bw);
                %setshape(xx,color_bw(1));
                set(xx,'Marker',symvol);
                set(xx,'markerfacecolor',[0 0 0]);
                set(xx,'MarkerEdgeColor',[0 0 0]);%color_bw1);
                set(xx,'MarkerSize',size);
                set(xx,'LineWidth',2);
            else
                set(xx,'markerfacecolor',color);
                set(xx,'MarkerSize',size);
                set(xx,'LineWidth',2);
            end
        end       
    end    
    legend(names,2);
else
    if isempty(min_legend_handle)
    else
        ax1=min_legend_handle;
        axes(ax1);
        cla;
        legend(ax1,'hide');
        set(ax1,'Visible','off');
    end
    
end
