function plotsettrect(handles,datadim,datasizes,modes)

iscirc=0;
axes(handles.mainframe1);
set(handles.radiobutton14,'Value',1);
[s,wt]=vsettings(datadim,datasizes,iscirc);
if datadim==1
    cla;
    plot(modes{1});
    set(handles.mainframe1,'Position',[53 90 450 450]);
    set(handles.popupmenu2,'String',wt);
    set(handles.popupmenu2,'Value',1);
    set(handles.popupmenu10,'String',s);
    set(handles.popupmenu10,'Value',1);
    set(handles.slider1,'Enable','inactive');
    set(handles.slider2,'Enable','inactive');
    set(handles.edit8,'String','NA'); set(handles.edit9,'String','NA');
    set(handles.edit8,'Enable','inactive'); set(handles.edit9,'Enable','inactive');
    set(handles.popupmenu9,'Enable','inactive');
    xlimits=get(handles.mainframe1,'XLim');
    set(handles.edit10,'String',num2str(xlimits(1)));
    set(handles.edit11,'String',num2str(xlimits(2)));
    ylimits=get(handles.mainframe1,'YLim');
    set(handles.edit12,'String',num2str(ylimits(1)));
    set(handles.edit13,'String',num2str(ylimits(2)));
    set(handles.edit14,'String','NA');
    set(handles.edit15,'String','NA');
    set(handles.edit14,'Enable','inactive');
    set(handles.edit15,'Enable','inactive');
    set(handles.checkbox19,'Enable','inactive');
    set(handles.checkbox20,'Value',1);
elseif datadim==2
    cla;
    imagesc(modes{1});
    axis xy;
    nbcol=256; bright=0;
    colormap(jet(nbcol));
    set(handles.slider1,'Value',nbcol); set(handles.slider2,'Value',bright);
    set(handles.edit8,'String',num2str(nbcol)); set(handles.edit9,'String',num2str(bright));
    set(handles.popupmenu9,'Enable','on');
    c=colorbar('location','southoutside');
    cpos = get(c,'Position');
    cpos=[0.052657004830918 0.083762149799886 0.435748792270531 0.5*cpos(4)];
    set(c,'Position',cpos);
    set(handles.mainframe1,'Position',[53 90 450 450]);
    set(handles.popupmenu10,'String',s);
    set(handles.popupmenu10,'Value',2);
    set(handles.popupmenu2,'String',wt);
    set(handles.popupmenu2,'Value',1);
    xlimits=get(handles.mainframe1,'XLim');
    set(handles.edit10,'String',num2str(xlimits(1)));
    set(handles.edit11,'String',num2str(xlimits(2)));
    ylimits=get(handles.mainframe1,'YLim');
    set(handles.edit12,'String',num2str(ylimits(1)));
    set(handles.edit13,'String',num2str(ylimits(2)));
    zlimits=get(handles.mainframe1,'ZLim');
    set(handles.edit14,'String',num2str(zlimits(1)));
    set(handles.edit15,'String',num2str(zlimits(2)));
    set(handles.checkbox20,'Value',1);
elseif datadim==3
    cla;
    vol3d('CData',modes{1},'texture','3D');
    view(3);
    axis tight;
    alphamap('rampup',256);
    zlimits=get(handles.mainframe1,'ZLim');
    set(handles.slider3,'Min',1);
    set(handles.slider3,'Max',zlimits(2));
    set(handles.edit18,'String',num2str(zlimits(2))); set(handles.slider3,'Value',zlimits(2));
    nbcol=256; bright=0;
    colormap(jet(nbcol));
    set(handles.slider1,'Value',nbcol); set(handles.slider2,'Value',bright);
    set(handles.edit8,'String',num2str(nbcol)); set(handles.edit9,'String',num2str(bright));
    set(handles.popupmenu9,'Enable','on');
    c=colorbar('location','southoutside');
    cpos = get(c,'Position');
    cpos=[0.052657004830918 0.083762149799886 0.435748792270531 0.5*cpos(4)];
    set(c,'Position',cpos);
    set(handles.mainframe1,'Position',[53 90 450 450]);
    set(handles.popupmenu10,'String',s);
    set(handles.popupmenu10,'Value',1);
    set(handles.popupmenu2,'String',wt);
    set(handles.popupmenu2,'Value',1);
    xlimits=get(handles.mainframe1,'XLim');
    set(handles.edit10,'String',num2str(xlimits(1)));
    set(handles.edit11,'String',num2str(xlimits(2)));
    ylimits=get(handles.mainframe1,'YLim');
    set(handles.edit12,'String',num2str(ylimits(1)));
    set(handles.edit13,'String',num2str(ylimits(2)));
    set(handles.edit14,'String',num2str(zlimits(1)));
    set(handles.edit15,'String',num2str(zlimits(2)));
    set(handles.checkbox20,'Value',1);
end