function ezlabels(command)
    %
    %   GUI input for labels and titles
    %
    %   typing 'ezlabels' from the command line opens an
    %   interactive dialogue box, allowing the user to specify
    %   axes labels and the figure title as well as the Font, Size, Weight
    %   and Angle using pulldown menus.
    %
    %   Note: This function uses the ten standard postscript fonts
    %         available on most platforms.  Not all font
    %         combinations are available on all platforms and/or
    %         hardcopy devices.
    %
    %   Richard G. Cobb    3/96
    %   rcobb@afit.af.mil
    %
    if nargin < 1
        siblines(4)=get(gca,'Title');
        siblines(3)=get(gca,'Xlabel');
        siblines(2)=get(gca,'Ylabel');
        siblines(1)=get(gca,'Zlabel');
        %
        haold=gcf;
        T1=['Avant Garde           ';...
            'Bookman               ';...
            'Courier               ';...
            'Helvetica             ';...
            'Helvetica Narrow      ';...
            'New Century Schoolbook';...
            'Palatino              ';...
            'Symbol                ';...
            'Times                 ';...
            'Zapf Chancery         ';...
            'Zapf Dingbats         '];
        T2=['cyan   ';'magenta';'green  ';'red    ';'yellow ';...
            'blue   ';'black  ';'white  '];
        T5=['Normal ';...
            'Light  ';...
            'Demi   ';...
            'Bold   '];
        T4=['Normal ';'Italic ';'Oblique'];
        T3=['10';'12';'16';'20';'24';'30'];

        si=[0 0 0 0 0 0]';si2=si;
        si(1:length(siblines))=siblines;
        leginp=figure_w_normalized_uicontrolunits('Color',[0.9 0.9 0.9],'NumberTitle','off','Name',...
            'EZ LABELS',...
            'NextPlot','new',...
            'Units','Normalized',...
            'Position',[.1 .1  .4 .1+.05*length(siblines)]);
        sfactor=.25/(.1+.05*length(siblines));
        axis off
        axis([0,1,0,1])
        Y = linspace(0,.75,length(siblines))';
        ui=[0 0 0 0 0 0]'; bi=[0 0 0 0 0 0]';
        for i=1:length(siblines)
            examps(i)=text(0,[Y(i)],get(siblines(i),'string'),...
                'FontName',get(siblines(i),'FontName'),...
                'Color',get(siblines(i),'Color') ,...
                'FontSize',get(siblines(i),'FontSize'),...
                'FontAngle',get(siblines(i),'FontAngle'),...
                'FontWeight',get(siblines(i),'FontWeight'));
            ui(i) = uicontrol('Parent',leginp,...
                'style','edit',...
                'string',get(siblines(i),'string'),...
                'units','normalized',...
                'position',[.35 (Y(i)+.1)/1.2 .3 .1*sfactor]);
            bi(i) = uicontrol('Style','checkbox','Units','Normalized',...
                'Position',[.28 (Y(i)+.1)/1.2 .05 .1*sfactor],...
                'Visible','on');
        end

        si2(1:length(examps))=examps;
        mi(1) = uicontrol('Style','Popup','Units','Normalized',...
            'Position',[.7 .8 .25 .1*sfactor],...
            'String',T1,...
            'Visible','on',...
            'HorizontalAlignment', 'left',...
            'Callback','ezlabels(1)');
        li(1) = uicontrol('Style','pushbutton','Units','Normalized',...
            'Position',[.7 .8 .25 .1*sfactor],...
            'String','Fontname',...
            'Visible','on',...
            'Callback','ezlabels(8)');
        mi(2) = uicontrol('Style','Popup','Units','Normalized',...
            'Position',[.7 .6 .25 .1*sfactor],...
            'String',T2,...
            'Visible','on',...
            'HorizontalAlignment', 'left',...
            'Callback','ezlabels(2)');
        li(2) = uicontrol('Style','pushbutton','Units','Normalized',...
            'Position',[.7 .6 .25 .1*sfactor],...
            'String','Color',...
            'Visible','on',...
            'Callback','ezlabels(9)');

        mi(3) = uicontrol('Style','Popup','Units','Normalized',...
            'Position',[.7 .4 .25 .1*sfactor],...
            'String',T3,...
            'Visible','on',...
            'HorizontalAlignment', 'left',...
            'Callback','ezlabels(3)');
        li(3) = uicontrol('Style','pushbutton','Units','Normalized',...
            'Position',[.7 .4 .25 .1*sfactor],...
            'String','FontSize',...
            'Visible','on',...
            'Callback','ezlabels(10)');

        mi(4) = uicontrol('Style','Popup','Units','Normalized',...
            'Position',[.7 .2 .25 .1*sfactor],...
            'String',T4,...
            'Visible','off',...
            'HorizontalAlignment', 'left',...
            'Callback','ezlabels(4)');
        li(4) = uicontrol('Style','pushbutton','Units','Normalized',...
            'Position',[.7 .2 .25 .1*sfactor],...
            'String','Fontangle',...
            'Visible','on',...
            'Callback','ezlabels(7)');
        mi(5) = uicontrol('Style','Popup','Units','Normalized',...
            'Position',[.7 0 .25 .1*sfactor],...
            'String',T5,...
            'Visible','off',...
            'HorizontalAlignment', 'left',...
            'Callback','ezlabels(12)');
        li(5) = uicontrol('Style','pushbutton','Units','Normalized',...
            'Position',[.7 0 .25 .1*sfactor],...
            'String','Fontweight',...
            'Visible','on',...
            'Callback','ezlabels(11)');



        uicontrol('Parent',leginp,...
            'style','text',...
            'string','Title',...
            'units','normalized',...
            'position',[.4 ((max(Y)+.1)/1.2)+.1*sfactor .2 .07*sfactor],...
            'BackgroundColor',[ 0 0 0 ],...
            'ForegroundColor',[ 0 1 0 ]);
        uicontrol('Parent',leginp,...
            'style','text',...
            'string','Xlabel',...
            'units','normalized',...
            'position',[.4 ((Y(3)+.1)/1.2)+.1*sfactor .2 .07*sfactor],...
            'BackgroundColor',[ 0 0 0 ],...
            'ForegroundColor',[ 0 1 0 ]);

        uicontrol('Parent',leginp,...
            'style','text',...
            'string','Ylabel',...
            'units','normalized',...
            'position',[.4 ((Y(2)+.1)/1.2)+.1*sfactor .2 .07*sfactor],...
            'BackgroundColor',[ 0 0 0 ],...
            'ForegroundColor',[ 0 1 0 ]);
        uicontrol('Parent',leginp,...
            'style','text',...
            'string','Zlabel',...
            'units','normalized',...
            'position',[.4 ((Y(1)+.1)/1.2)+.1*sfactor .2 .07*sfactor],...
            'BackgroundColor',[ 0 0 0 ],...
            'ForegroundColor',[ 0 1 0 ]);

        uicontrol('Parent',leginp,...
            'style','pushbutton',...
            'string','Close',...
            'units','normalized',...
            'position',[.3 .92 .15 .07*sfactor],...
             'Callback','delete(gcf)');

        uicontrol('Parent',leginp,...
            'style','pushbutton',...
            'string','Add Labels',...
            'units','normalized',...
            'position',[.5 .92 .2 .07*sfactor],...
             'Callback','ezlabels(6)');


        mh=zeros(size(ui));mh(1:5)=mi;mh(6)=haold;
        lh=zeros(size(ui));lh(1:5)=li;
        set(leginp,'UserData',[si ui bi mh si2 lh]);

    elseif command==1
        T1=['Avant Garde           ';...
            'Bookman               ';...
            'Courier               ';...
            'Helvetica             ';...
            'Helvetica Narrow      ';...
            'New Century Schoolbook';...
            'Palatino              ';...
            'Symbol                ';...
            'Times                 ';...
            'Zapf Chancery         ';...
            'Zapf Dingbats         '];

        handles = get(gcf,'UserData');
        checked=zeros(4,1);
        for i=1:4
            checked(i)=get(handles(i,3),'Value');
        end
        for i=find(checked)
            set(handles(i,1),'Fontname',deblank(T1(get(handles(1,4),'Value'),:)))
            set(handles(i,5),'Fontname',deblank(T1(get(handles(1,4),'Value'),:)))
        end
        refresh
        refresh(handles(6,4))
        set(handles(1,4),'Visible', 'off')
        set(handles(1,6),'Visible', 'on')

    elseif command==2
        T2=['cyan   ';'magenta';'green  ';'red    ';'yellow ';...
            'blue   ';'black  ';'white  '];
        handles = get(gcf,'UserData');
        checked=zeros(4,1);
        for i=1:4
            checked(i)=get(handles(i,3),'Value');
        end
        for i=find(checked)
            set(handles(i,1),'Color',T2(get(handles(2,4),'Value'),:))
            set(handles(i,5),'Color',T2(get(handles(2,4),'Value'),:))
        end
        set(handles(2,4),'Visible', 'off')
        set(handles(2,6),'Visible', 'on')

    elseif command==3
        T3=['10';'12';'16';'20';'24';'30'];
        handles = get(gcf,'UserData');
        checked=zeros(4,1);
        for i=1:4
            checked(i)=get(handles(i,3),'Value');
        end
        for i=find(checked)
            set(handles(i,1),'FontSize',eval(T3(get(handles(3,4),'Value'),:)))
            set(handles(i,5),'FontSize',eval(T3(get(handles(3,4),'Value'),:)))
        end
        refresh
        refresh(handles(6,4))
        set(handles(3,4),'Visible', 'off')
        set(handles(3,6),'Visible', 'on')

    elseif command==4
        T4=['normal ';'italic ';'oblique'];
        handles = get(gcf,'UserData');
        checked=zeros(4,1);
        for i=1:4
            checked(i)=get(handles(i,3),'Value');
        end
        for i=find(checked)
            set(handles(i,1),'FontAngle',T4(get(handles(4,4),'Value'),:))
            set(handles(i,5),'FontAngle',T4(get(handles(4,4),'Value'),:))
        end
        refresh
        refresh(handles(6,4))
        set(handles(4,4),'Visible', 'off')
        set(handles(4,6),'Visible', 'on')
    elseif command==12
        T5=['Normal ';...
            'Light  ';...
            'Demi   ';...
            'Bold   '];
        handles = get(gcf,'UserData');
        checked=zeros(4,1);
        for i=1:4
            checked(i)=get(handles(i,3),'Value');
        end
        for i=find(checked)
            set(handles(i,1),'FontWeight',T5(get(handles(5,4),'Value'),:))
            set(handles(i,5),'FontWeight',T5(get(handles(5,4),'Value'),:))
        end
        refresh
        refresh(handles(6,4))
        set(handles(5,4),'Visible', 'off')
        set(handles(5,6),'Visible', 'on')

    elseif command == 5

    elseif command == 6
        handles = get(gcf,'UserData');
        for i=1:4
            set(handles(i,1),'string', get(handles(i,2),'string'))
            set(handles(i,5),'string', get(handles(i,2),'string'))
        end
    elseif command == 7
        handles = get(gcf,'UserData');
        set(handles(4,6),'Visible', 'off')
        set(handles(4,4),'Visible', 'on')
    elseif command == 8
        handles = get(gcf,'UserData');
        set(handles(1,6),'Visible', 'off')
        set(handles(1,4),'Visible', 'on')
    elseif command == 9
        handles = get(gcf,'UserData');
        set(handles(2,6),'Visible', 'off')
        set(handles(2,4),'Visible', 'on')
    elseif command == 10
        handles = get(gcf,'UserData');
        set(handles(3,6),'Visible', 'off')
        set(handles(3,4),'Visible', 'on')
    elseif command == 11
        handles = get(gcf,'UserData');
        set(handles(5,6),'Visible', 'off')
        set(handles(5,4),'Visible', 'on')

    end
