- Timestamp:
- May 19, 2012, 12:38:14 PM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r426 r428 47 47 % .Coordinates: coordinate parameters: 48 48 % .CheckFixLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits 49 % .Coordinates.CheckFix Equal: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales.49 % .Coordinates.CheckFixAspectRatio: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales. 50 50 % --scalars-- 51 51 % .Scalar.MaxA: upper bound (saturation color) for the scalar representation, max(field) by default … … 200 200 set(haxes,'YLimMode', 'auto') 201 201 end 202 if ~isfield(PlotParam.Coordinates,'CheckFix Equal')&& isfield(Data,'CoordUnit')203 PlotParam.Coordinates.CheckFix Equal=1;% if CoordUnit is defined, the two coordiantes should be plotted with equal scale by default204 end 205 if isfield(PlotParam.Coordinates,'CheckFixEqual') && isequal(PlotParam.Coordinates.CheckFixEqual,1)206 set(haxes,'DataAspectRatioMode','manual')207 set(haxes,'DataAspectRatio',[1 1 1])208 else209 set(haxes,'DataAspectRatioMode','auto')%automatic aspect ratio210 end202 if ~isfield(PlotParam.Coordinates,'CheckFixAspectRatio')&& isfield(Data,'CoordUnit') 203 PlotParam.Coordinates.CheckFixAspectRatio=1;% if CoordUnit is defined, the two coordiantes should be plotted with equal scale by default 204 end 205 % if isfield(PlotParam.Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1) 206 % set(haxes,'DataAspectRatioMode','manual') 207 % set(haxes,'DataAspectRatio',[1 1 1]) 208 % else 209 % set(haxes,'DataAspectRatioMode','auto')%automatic aspect ratio 210 % end 211 211 errormsg=''; 212 212 … … 471 471 end 472 472 htitle=title(title_str); 473 txt=ver('MATLAB');474 Release=txt.Release;475 relnumb=str2double(Release(3:4));476 if relnumb >= 14477 478 end473 % txt=ver('MATLAB'); 474 % Release=txt.Release; 475 % relnumb=str2double(Release(3:4)); 476 % if relnumb >= 14 477 set(htitle,'Interpreter','none')% desable tex interpreter 478 % end 479 479 end 480 480 … … 496 496 CoordinatesOut.MinY=min(YMin_cell); 497 497 CoordinatesOut.MaxY=max(YMax_cell); 498 end 499 500 %% determine plot aspect ratio 501 if isequal(Coordinates.CheckFixAspectRatio,1)&&isfield(Coordinates,'AspectRatio') 502 set(haxes,'DataAspectRatioMode','manual') 503 set(haxes,'DataAspectRatio',[Coordinates.AspectRatio 1 1]) 504 else 505 set(haxes,'DataAspectRatioMode','auto')%automatic aspect ratio 506 AspectRatio=get(haxes,'DataAspectRatio') 507 CoordinatesOut.AspectRatio=AspectRatio(1)/AspectRatio(2); 498 508 end 499 509 … … 705 715 siz=numel(np); 706 716 if siz>3 707 errormsg=['unrecognized scalar type: ' num2str(siz) ' dimensions'];708 717 errormsg=['unrecognized scalar type: ' num2str(siz) ' dimensions']; 718 return 709 719 end 710 720 if siz==3 … … 725 735 BW=(siz==2) && (isa(A,'uint8')|| isa(A,'uint16'));% non color images represented in gray scale by default 726 736 PlotParamOut.Scalar.CheckBW=BW; 727 end 737 end 728 738 %case of grey level images or contour plot 729 if siz==2 739 if siz==2 730 740 if ~isfield(PlotParam.Scalar,'CheckFixScalar') 731 741 PlotParam.Scalar.CheckFixScalar=0;%default … … 742 752 Aline=Aline(~isnan(A)); 743 753 if isempty(Aline) 744 754 errormsg='NaN input scalar or image in plot_field'; 745 755 return 746 756 end … … 748 758 else 749 759 MinA=PlotParam.Scalar.MinA; 750 end; 760 end; 751 761 if ~PlotParam.Scalar.CheckFixScalar||isempty(PlotParam.Scalar.MaxA)||~isa(PlotParam.Scalar.MaxA,'double') %correct if there is no numerical data in edit box 752 762 if isempty(Aline) 753 Aline=reshape(A,1,[]);754 Aline=Aline(~isnan(A));755 if isempty(Aline)756 errormsg='NaN input scalar or image in plot_field';757 return758 end763 Aline=reshape(A,1,[]); 764 Aline=Aline(~isnan(A)); 765 if isempty(Aline) 766 errormsg='NaN input scalar or image in plot_field'; 767 return 768 end 759 769 end 760 770 MaxA=double(max(Aline)); 761 771 else 762 MaxA=PlotParam.Scalar.MaxA; 763 end; 772 MaxA=PlotParam.Scalar.MaxA; 773 end; 764 774 PlotParamOut.Scalar.MinA=MinA; 765 775 PlotParamOut.Scalar.MaxA=MaxA; … … 777 787 PlotParamOut.Scalar.IncrA=intercont; 778 788 else 779 intercont=PlotParam.Scalar.IncrA;780 end 781 B=A; 789 intercont=PlotParam.Scalar.IncrA; 790 end 791 B=A; 782 792 abscontmin=intercont*floor(MinA/intercont); 783 793 abscontmax=intercont*ceil(MaxA/intercont); … … 789 799 sizpx=(AX(end)-AX(1))/(np(2)-1); 790 800 sizpy=(AY(1)-AY(end))/(np(1)-1); 791 x_cont=AX(1):sizpx:AX(end); % pixel x coordinates for image display 801 x_cont=AX(1):sizpx:AX(end); % pixel x coordinates for image display 792 802 y_cont=AY(1):-sizpy:AY(end); % pixel x coordinates for image display 793 % axes(haxes)% set the input axes handle as current axis794 txt=ver('MATLAB');795 Release=txt.Release;803 % axes(haxes)% set the input axes handle as current axis 804 txt=ver('MATLAB'); 805 Release=txt.Release; 796 806 relnumb=str2double(Release(3:4)); 797 807 if relnumb >= 14 798 808 vec=linspace(0,1,(abscontmax-abscontmin)/intercont);%define a greyscale colormap with steps intercont 799 809 map=[vec' vec' vec']; 800 810 colormap(map); 801 [var,hcontour]=contour(x_cont,y_cont,B,cont_pos); 811 [var,hcontour]=contour(x_cont,y_cont,B,cont_pos); 802 812 set(hcontour,'Fill','on') 803 813 set(hcontour,'LineStyle','none') … … 809 819 set(hcontour_m,'LineColor',[1 1 1]) 810 820 hold off 811 caxis([abscontmin abscontmax]) 821 caxis([abscontmin abscontmax]) 812 822 colormap(map); 813 if isfield(PlotParam.Coordinates,'CheckFixEqual') && isequal(PlotParam.Coordinates.CheckFixEqual,1)823 if isfield(PlotParam.Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1) 814 824 set(haxes,'DataAspectRatioMode','manual') 815 set(haxes,'DataAspectRatio',[1 1 1]) 816 end 825 if isfield(PlotParam.Coordinates,'AspectRatio') 826 set(haxes,'DataAspectRatio',[PlotParam.Coordinates.AspectRatio PlotParam.Coordinates.AspectRatio PlotParam.Coordinates.AspectRatio]) 827 else 828 set(haxes,'DataAspectRatio',[1 1 1]) 829 end 830 end 817 831 end 818 832 … … 824 838 vec=linspace(0,1,255);%define a linear greyscale colormap 825 839 map=[vec' vec' vec']; 826 colormap(map); %grey scale color map 840 colormap(map); %grey scale color map 827 841 else 828 colormap('default'); % standard faulse colors for div, vort , scalar fields 842 colormap('default'); % standard faulse colors for div, vort , scalar fields 829 843 end 830 844 end 831 845 832 % case of color images833 else 846 % case of color images 847 else 834 848 if BW 835 849 B=uint16(sum(A,3)); … … 842 856 843 857 % display usual image 844 if ~CheckContour 858 if ~CheckContour 845 859 % interpolate field to increase resolution of image display 846 860 test_interp=1; 847 if max(np) <= 64 861 if max(np) <= 64 848 862 npxy=8*np;% increase the resolution 8 times 849 elseif max(np) <= 128 863 elseif max(np) <= 128 850 864 npxy=4*np;% increase the resolution 4 times 851 elseif max(np) <= 256 865 elseif max(np) <= 256 852 866 npxy=2*np;% increase the resolution 2 times 853 867 else … … 855 869 test_interp=0; % no interpolation done 856 870 end 857 if test_interp==1%if we interpolate 871 if test_interp==1%if we interpolate 858 872 x=linspace(AX(1),AX(2),np(2)); 859 873 y=linspace(AY(1),AY(2),np(1)); … … 862 876 yi=linspace(AY(1),AY(2),npxy(1)); 863 877 B = interp2(X,Y,double(B),xi,yi'); 864 end 878 end 865 879 % create new image if there no image handle is found 866 if isempty(hima) 880 if isempty(hima) 867 881 tag=get(haxes,'Tag'); 868 882 if MinA<MaxA … … 871 885 hima=imagesc(AX,AY,B,[MaxA-1 MaxA]); 872 886 end 873 % the function imagesc reset the axes 'DataAspectRatioMode'='auto', change if .CheckFix Equalis887 % the function imagesc reset the axes 'DataAspectRatioMode'='auto', change if .CheckFixAspectRatio is 874 888 % requested: 875 if isfield(PlotParam.Coordinates,'CheckFixEqual') && isequal(PlotParam.Coordinates.CheckFixEqual,1)889 if isfield(PlotParam.Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1) 876 890 set(haxes,'DataAspectRatioMode','manual') 877 891 set(haxes,'DataAspectRatio',[1 1 1]) 878 end892 end 879 893 set(hima,'Tag','ima') 880 894 set(hima,'HitTest','off') 881 set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!) 895 set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!) 882 896 uistack(hima, 'bottom') 883 % update an existing image897 % update an existing image 884 898 else 885 899 set(hima,'CData',B); … … 893 907 end 894 908 % set the transparency to 0.5 if vectors are also plotted 895 if test_vec 896 set(hima,'AlphaData',0.5) 897 else 898 set(hima,'AlphaData',1) 909 if isfield(PlotParam.Scalar,'Opacity')&& ~isempty(PlotParam.Scalar.Opacity) 910 set(hima,'AlphaData',PlotParam.Scalar.Opacity) 911 else 912 if test_vec 913 set(hima,'AlphaData',0.5)%set opacity to 0.5 by default in the presence of vectors 914 PlotParamOut.Scalar.Opacity=0.5; 915 else 916 set(hima,'AlphaData',1)% full opacity (no transparency) by default 917 end 899 918 end 900 919 end … … 904 923 if siz==2 && exist('PosColorbar','var')&& ~isempty(PosColorbar) 905 924 if isempty(hcol)||~ishandle(hcol) 906 925 hcol=colorbar;%create new colorbar 907 926 end 908 927 if length(PosColorbar)==4 909 set(hcol,'Position',PosColorbar)910 end 928 set(hcol,'Position',PosColorbar) 929 end 911 930 %YTick=0;%default 912 931 if MaxA>MinA 913 932 if CheckContour 914 933 colbarlim=get(hcol,'YLim'); 915 scale_bar=(colbarlim(2)-colbarlim(1))/(abscontmax-abscontmin); 934 scale_bar=(colbarlim(2)-colbarlim(1))/(abscontmax-abscontmin); 916 935 YTick=cont_pos(2:end-1); 917 936 YTick_scaled=colbarlim(1)+scale_bar*(YTick-abscontmin); … … 926 945 set(hcol,'YLim',[MinA MaxA]) 927 946 YTick=colbartick(MinA,MaxA); 928 set(hcol,'YTick',YTick) 947 set(hcol,'YTick',YTick) 929 948 else 930 949 hi=get(hcol,'children'); … … 934 953 set(hi,'YData',[MinA MaxA]) 935 954 set(hi,'CData',(1:64)') 936 YTick=colbartick(MinA,MaxA); 955 YTick=colbartick(MinA,MaxA); 937 956 set(hcol,'YLim',[MinA MaxA]) 938 957 set(hcol,'YTick',YTick) … … 941 960 end 942 961 elseif ishandle(hcol) 943 delete(hcol); %erase existing colorbar if not needed 962 delete(hcol); %erase existing colorbar if not needed 944 963 end 945 964 else%no scalar plot 946 if ~isempty(hima) && ishandle(hima) 965 if ~isempty(hima) && ishandle(hima) 947 966 delete(hima) 948 967 end 949 968 if ~isempty(hcol)&& ishandle(hcol) 950 delete(hcol)969 delete(hcol) 951 970 end 952 971 PlotParamOut=rmfield(PlotParamOut,'Scalar'); -
trunk/src/series.m
r427 r428 1954 1954 delete(hget_field)%delete opened versions of get_field 1955 1955 end 1956 SeriesData=get(handles.series,'UserData'); 1957 filename=SeriesData.CurrentInputFile; 1958 if exist(filename,'file') 1959 get_field(filename) 1956 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(read_GUI(handles.series)); 1957 if exist(filecell{1,1},'file') 1958 get_field(filecell{1,1}) 1960 1959 end 1961 1960 elseif isequal(field,'more...') -
trunk/src/sub_field.m
r405 r428 300 300 end 301 301 end 302 if ~testX_1 303 DimCell=[{XName_1_1} {YName_1_1}]; 302 if ~testX_1% if the second field has structured coordinates 303 DimCell={XName_1_1,YName_1_1, {YName_1_1,XName_1_1}}; 304 else 305 DimCell=[DimCell Field_1.VarDimName(ivar_C_1)]; 304 306 end 305 307 SubData.ListVarName=[SubData.ListVarName {XName_1_1} {YName_1_1} {AName_1_1}]; 306 DimCell=[DimCell Field_1.VarDimName(ivar_C_1)]; %(TODO: check for dimension names)307 if testX_1308 % check that a different dimension name is used for the two fields 309 if testX_1% if the second field has unstructured coordinates 308 310 for icell=1:numel(DimCell) 309 311 if isequal(DimCell{icell}{1},SubData.VarDimName{1}{1}) … … 311 313 end 312 314 end 313 end315 end 314 316 SubData.VarDimName=[SubData.VarDimName DimCell]; 315 317 if isfield(Field_1,'VarAttribute') -
trunk/src/uvmat.m
r427 r428 1611 1611 sub_value= get(handles.SubField,'Value'); 1612 1612 if sub_value % a second input file has been entered 1613 [FileName_1,RootPath_1,filebase_1,FileIndices_1,FileExt_1,SubDir_1]=read_file_boxes_1(handles);1614 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat( FileIndices_1);1615 1613 [InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileIndex_1,InputFile.FileExt_1,InputFile.NomType_1]=read_file_boxes_1(handles); 1614 [tild,tild,tild,i1_1,i2_1,j1_1,j2_1]=fileparts_uvmat(InputFile.FileIndex_1); 1615 % InputFile.NomType_1=get(handles.NomType_1,'String'); 1616 1616 else 1617 1617 filename_1=[]; … … 1742 1742 filename=fullfile_uvmat(InputFile.RootPath,InputFile.SubDir,InputFile.RootFile,FileExt,NomType,i1,i2,j1,j2); 1743 1743 if sub_value 1744 filename_1=fullfile_uvmat(InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1, FileExt_1,NomType_1,i1_1,i2_1,j1_1,j2_1);1744 filename_1=fullfile_uvmat(InputFile.RootPath_1,InputFile.SubDir_1,InputFile.RootFile_1,InputFile.FileExt_1,InputFile.NomType_1,i1_1,i2_1,j1_1,j2_1); 1745 1745 end 1746 1746 … … 1762 1762 set(handles.j2,'String',num2stra(j2,NomType,2)); 1763 1763 end 1764 % [indices]=name_generator('',i1,j1,'',NomType,1,i2,j2,'');1765 1764 indices=fullfile_uvmat('','','','',NomType,i1,i2,j1,j2); 1766 1765 set(handles.FileIndex,'String',indices); 1767 1766 if ~isempty(filename_1) 1768 indices_1=fullfile_uvmat('','','','',NomType_1,i1_1,i2_1,j1_1,j2_1); 1769 %indices_1=name_generator('',i1_1,j1_1,'',NomType_1,1,i2_1,j2_1,''); 1767 indices_1=fullfile_uvmat('','','','',InputFile.NomType_1,i1_1,i2_1,j1_1,j2_1); 1770 1768 set(handles.FileIndex_1,'String',indices_1); 1771 1769 end … … 2105 2103 end 2106 2104 end 2105 if isequal(get(handles.NomType_1,'Visible'),'on') 2107 2106 NomType_1=get(handles.NomType_1,'String'); 2107 else 2108 NomType_1=get(handles.NomType,'String'); 2109 end 2108 2110 test_keepdata_1=0;% test for keeping the previous stored data if the input files are unchanged 2109 2111 if ~isequal(NomType_1,'*')%in case of a series of files (not avi movie) … … 2638 2640 PlotParam{imap}.Scalar.CheckBW=[]; %B/W option depends on the input field (image or scalar) 2639 2641 if isfield(ObjectData,'CoordUnit') 2640 PlotParam{imap}.Coordinates.CheckFixEqual=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y) 2642 PlotParam{imap}.Coordinates.CheckFixAspectRatio=1;% set x and y scaling equal if CoordUnit is defined (common unit for x and y) 2643 PlotParam{imap}.Coordinates.AspectRatio=1; %set aspect ratio to 1 2641 2644 end 2642 2645 end … … 2883 2886 indy=1+round((nxy(1)-1)*(y12-rangy0(1))/(rangy0(2)-rangy0(1)));% index y of pixel 2884 2887 2888 2889 %------------------------------------------------------------------- 2890 % --- Executes on button press in 'CheckZoom'. 2891 %------------------------------------------------------------------- 2892 function CheckZoom_Callback(hObject, eventdata, handles) 2893 2894 if (get(handles.CheckZoom,'Value') == 1); 2895 set(handles.CheckZoom,'BackgroundColor',[1 1 0]) 2896 set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes 2897 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 2898 else 2899 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 2900 end 2901 2885 2902 %------------------------------------------------------------------- 2886 2903 % --- Executes on button press in 'CheckFixLimits'. … … 2896 2913 2897 2914 %------------------------------------------------------------------- 2898 % --- Executes on button press in CheckFixEqual. 2899 function CheckFixEqual_Callback(hObject, eventdata, handles) 2900 if get(handles.CheckFixEqual,'Value') 2901 set(handles.CheckFixEqual,'BackgroundColor',[1 1 0]) 2915 % --- Executes on button press in CheckFixAspectRatio. 2916 function CheckFixAspectRatio_Callback(hObject, eventdata, handles) 2917 %------------------------------------------------------------------- 2918 if get(handles.CheckFixAspectRatio,'Value') 2919 set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0]) 2902 2920 update_plot(handles); 2903 2921 else 2904 set(handles.CheckFix Equal,'BackgroundColor',[0.7 0.7 0.7])2922 set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7]) 2905 2923 update_plot(handles); 2906 2924 end 2907 2925 2908 2926 %------------------------------------------------------------------- 2909 2927 function num_AspectRatio_Callback(hObject, eventdata, handles) 2910 2928 %------------------------------------------------------------------- 2911 % --- Executes on button press in 'CheckZoom'. 2929 set(handles.CheckFixAspectRatio,'Value',1)% select the fixed aspect ratio button 2930 set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow 2931 update_plot(handles); 2912 2932 %------------------------------------------------------------------- 2913 function CheckZoom_Callback(hObject, eventdata, handles) 2914 2915 if (get(handles.CheckZoom,'Value') == 1); 2916 set(handles.CheckZoom,'BackgroundColor',[1 1 0]) 2917 set(handles.CheckFixLimits,'Value',1)% propose by default fixed limits for the plotting axes 2918 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 2919 else 2920 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 2921 end 2933 2934 %------------------------------------------------------------------- 2935 2936 2922 2937 2923 2938 %------------------------------------------------------------------- … … 2982 2997 fin=close(nc); 2983 2998 2984 %--------------------------------------------------- 2999 %------------------------------------------------------------------- 2985 3000 % --- Executes on button press in SubField 2986 3001 function SubField_Callback(hObject, eventdata, handles) 2987 % huvmat=get(handles.run0,'parent');3002 %------------------------------------------------------------------- 2988 3003 UvData=get(handles.uvmat,'UserData'); 2989 3004 if get(handles.SubField,'Value')==0% if the subfield button is desactivated … … 3002 3017 set(handles.Fields_1,'Value',1);%set to blank state 3003 3018 set(handles.VelType_1,'Value',1);%set to blank state 3019 set(handles.num_Opacity,'String','')% desactivate opacity setting 3004 3020 if ~strcmp(get(handles.VelType,'Visible'),'on') 3005 3021 set(handles.VelType_1,'Visible','off') … … 3172 3188 if isempty(field_1)%||(numel(UvData.FileType)>=2 && strcmp(UvData.FileType{2},'image')) 3173 3189 set(handles.SubField,'Value',0) 3174 % check_new=1;3175 3190 SubField_Callback(hObject, eventdata, handles) 3176 % if isempty(field_1)%remove second field if 'blank' field is selected 3177 return 3178 % end 3191 return 3179 3192 else 3180 3193 set(handles.SubField,'Value',1)%state that a second field is now entered … … 3201 3214 set(handles.transform_fct,'Value',1)% no transform by default 3202 3215 set(handles.path_transform,'String','') 3216 if check_new 3217 UvData.FileType{2}=UvData.FileType{1}; 3218 set(handles.FileIndex_1,'String',get(handles.FileIndex,'String')) 3219 % set(handles.FileExt_1,'String',get(handles.FileExt,'String')) 3220 set(handles.uvmat,'UserData',UvData) 3221 end 3203 3222 case 'image' 3204 3223 % guess the image name corresponding to the current netcdf name (no unique correspondance) … … 3708 3727 %------------------------------------------------------------------- 3709 3728 update_plot(handles); 3729 3730 %------------------------------------------------------------------- 3731 function num_Opacity_Callback(hObject, eventdata, handles) 3732 update_plot(handles); 3733 %------------------------------------------------------------------- 3710 3734 3711 3735 %------------------------------------------------------------------- … … 4786 4810 web(helpfile); 4787 4811 end 4788 4789 4790 % --- Executes on slider movement.4791 function slider7_Callback(hObject, eventdata, handles)4792 % hObject handle to slider7 (see GCBO)4793 % eventdata reserved - to be defined in a future version of MATLAB4794 % handles structure with handles and user data (see GUIDATA)4795 4796 % Hints: get(hObject,'Value') returns position of slider4797 % get(hObject,'Min') and get(hObject,'Max') to determine range of slider -
trunk/src/view_field.m
r425 r428 308 308 309 309 %------------------------------------------------------------------- 310 % --- Executes on button press in 'FixLimits'.311 %-------------------------------------------------------------------312 function CheckFixLimits_Callback(hObject, eventdata, handles)313 test=get(handles.CheckFixLimits,'Value');314 if test315 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0])316 else317 set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7])318 end319 update_plot(handles)320 321 %-------------------------------------------------------------------322 % --- Executes on button press in FixEqual.323 function CheckFixEqual_Callback(hObject, eventdata, handles)324 test=get(handles.CheckFixEqual,'Value');325 if test326 set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])327 else328 set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])329 end330 update_plot(handles)331 332 %-------------------------------------------------------------------333 334 %-------------------------------------------------------------------335 310 % --- Executes on button press in 'zoom'. 336 311 %------------------------------------------------------------------- … … 343 318 set(handles.CheckZoom,'BackgroundColor',[0.7 0.7 0.7]) 344 319 end 320 321 %------------------------------------------------------------------- 322 % --- Executes on button press in 'FixLimits'. 323 %------------------------------------------------------------------- 324 function CheckFixLimits_Callback(hObject, eventdata, handles) 325 test=get(handles.CheckFixLimits,'Value'); 326 if test 327 set(handles.CheckFixLimits,'BackgroundColor',[1 1 0]) 328 else 329 set(handles.CheckFixLimits,'BackgroundColor',[0.7 0.7 0.7]) 330 end 331 update_plot(handles) 332 333 %------------------------------------------------------------------- 334 % --- Executes on button press in CheckFixAspectRatio. 335 function CheckFixAspectRatio_Callback(hObject, eventdata, handles) 336 %------------------------------------------------------------------- 337 if get(handles.CheckFixAspectRatio,'Value') 338 set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0]) 339 update_plot(handles); 340 else 341 set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7]) 342 update_plot(handles); 343 end 344 345 %------------------------------------------------------------------- 346 function num_AspectRatio_Callback(hObject, eventdata, handles) 347 %------------------------------------------------------------------- 348 set(handles.CheckFixAspectRatio,'Value',1)% select the fixed aspect ratio button 349 set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow 350 update_plot(handles); 351 352 %------------------------------------------------------------------- 345 353 346 354 % %------------------------------------------------------------------- … … 746 754 % --- Executes on selection change in ColorCode. 747 755 function ColorCode_Callback(hObject, eventdata, handles) 748 % hObject handle to ColorCode (see GCBO)749 % eventdata reserved - to be defined in a future version of MATLAB750 % handles structure with handles and user data (see GUIDATA)751 752 % Hints: contents = cellstr(get(hObject,'String')) returns ColorCode contents as cell array753 % contents{get(hObject,'Value')} returns selected item from ColorCode754 756 755 757 756 758 % --- Executes on selection change in ColorScalar. 757 759 function ColorScalar_Callback(hObject, eventdata, handles) 758 % hObject handle to ColorScalar (see GCBO)759 % eventdata reserved - to be defined in a future version of MATLAB760 % handles structure with handles and user data (see GUIDATA)761 762 % Hints: contents = cellstr(get(hObject,'String')) returns ColorScalar contents as cell array763 % contents{get(hObject,'Value')} returns selected item from ColorScalar764 765 760 766 761 767 762 function num_ColCode2_Callback(hObject, eventdata, handles) 768 % hObject handle to num_colcode2 (see GCBO) 769 % eventdata reserved - to be defined in a future version of MATLAB 770 % handles structure with handles and user data (see GUIDATA) 771 772 % Hints: get(hObject,'String') returns contents of num_colcode2 as text 773 % str2double(get(hObject,'String')) returns contents of num_colcode2 as a double 763 764 765 -
trunk/src/write_plot_param.m
r421 r428 4 4 if isfield(PlotParam,'Coordinates') 5 5 Coordinates=PlotParam.Coordinates; 6 if isfield(Coordinates,'CheckFix Equal')7 if Coordinates.CheckFix Equal8 set(handles.CheckFix Equal,'Value',1)9 set(handles.CheckFix Equal,'BackgroundColor',[1 1 0])6 if isfield(Coordinates,'CheckFixAspectRatio') 7 if Coordinates.CheckFixAspectRatio 8 set(handles.CheckFixAspectRatio,'Value',1) 9 set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0]) 10 10 else 11 set(handles.CheckFix Equal,'Value',0)12 set(handles.CheckFix Equal,'BackgroundColor',[0.7 0.7 0.7])11 set(handles.CheckFixAspectRatio,'Value',0) 12 set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7]) 13 13 end 14 14 end 15 if isfield(Coordinates,'AspectRatio') 16 set(handles.num_AspectRatio,'String',num2str(Coordinates.AspectRatio)) 17 end 15 18 if isfield(Coordinates,'MinX') 16 19 set(handles.num_MinX,'String',num2str(Coordinates.MinX,4)); … … 34 37 if isfield(PlotParam.Scalar,'MinA') 35 38 set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3)); 36 end 37 39 end 38 40 if isfield(PlotParam.Scalar,'IncrA') 39 41 set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3)) 40 42 end 41 43 set(handles.CheckBW,'Value',PlotParam.Scalar.CheckBW) 44 if isfield(PlotParam.Scalar,'Opacity')&&isfield(handles,'num_Opacity') 45 set(handles.num_Opacity,'String',num2str(PlotParam.Scalar.Opacity)) 46 end 42 47 else 43 48 set(handles.Scalar,'Visible','off')
Note: See TracChangeset
for help on using the changeset viewer.