- Timestamp:
- Mar 4, 2014, 10:21:08 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r690 r729 406 406 end 407 407 end 408 MinX(icell)=min(coord_x{icell}); 409 MaxX(icell)=max(coord_x{icell}); 410 testplot(coord_x_index)=0; 411 if isfield(CellInfo{icell},'VarIndex_ancillary') 412 testplot(CellInfo{icell}.VarIndex_ancillary)=0; 413 end 414 if isfield(CellInfo{icell},'VarIndex_warnflag') 415 testplot(CellInfo{icell}.VarIndex_warnflag)=0; 416 end 417 if isfield(data,'VarAttribute') 418 VarAttribute=data.VarAttribute; 408 if ~isempty(coord_x{icell}) 409 MinX(icell)=min(coord_x{icell}); 410 MaxX(icell)=max(coord_x{icell}); 411 testplot(coord_x_index)=0; 412 if isfield(CellInfo{icell},'VarIndex_ancillary') 413 testplot(CellInfo{icell}.VarIndex_ancillary)=0; 414 end 415 if isfield(CellInfo{icell},'VarIndex_warnflag') 416 testplot(CellInfo{icell}.VarIndex_warnflag)=0; 417 end 418 if isfield(data,'VarAttribute') 419 VarAttribute=data.VarAttribute; 420 for ivar=1:length(VarIndex) 421 if length(VarAttribute)>=VarIndex(ivar) && isfield(VarAttribute{VarIndex(ivar)},'long_name') 422 plotname{VarIndex(ivar)}=VarAttribute{VarIndex(ivar)}.long_name; 423 else 424 plotname{VarIndex(ivar)}=data.ListVarName{VarIndex(ivar)};%name for display in plot A METTRE 425 end 426 end 427 end 428 if isfield(CellInfo{icell},'VarIndex_discrete') 429 charplot_0='''+'''; 430 else 431 charplot_0='''-'''; 432 end 433 MinY=[]; 434 MaxY=[];%default 435 436 nbplot=0; 419 437 for ivar=1:length(VarIndex) 420 if length(VarAttribute)>=VarIndex(ivar) && isfield(VarAttribute{VarIndex(ivar)},'long_name') 421 plotname{VarIndex(ivar)}=VarAttribute{VarIndex(ivar)}.long_name; 422 else 423 plotname{VarIndex(ivar)}=data.ListVarName{VarIndex(ivar)};%name for display in plot A METTRE 424 end 425 end 426 end 427 if isfield(CellInfo{icell},'VarIndex_discrete') 428 charplot_0='''+'''; 429 else 430 charplot_0='''-'''; 431 end 432 MinY=[]; 433 MaxY=[];%default 434 435 nbplot=0; 436 for ivar=1:length(VarIndex) 437 if testplot(VarIndex(ivar)) 438 VarName=data.ListVarName{VarIndex(ivar)}; 439 nbplot=nbplot+1; 440 ytitle=[ytitle VarName]; 441 if isfield(data,'VarAttribute')&& numel(data.VarAttribute)>=VarIndex(ivar) && isfield(data.VarAttribute{VarIndex(ivar)},'units') 442 ytitle=[ytitle '(' data.VarAttribute{VarIndex(ivar)}.units '), ']; 443 else 444 ytitle=[ytitle ', ']; 445 end 446 eval(['data.' VarName '=squeeze(data.' VarName ');']) 447 MinY(ivar)=min(min(data.(VarName))); 448 MaxY(ivar)=max(max(data.(VarName))); 449 plotstr=[plotstr 'coord_x{' num2str(icell) '},data.' VarName ',' charplot_0 ',']; 450 eval(['nbcomponent2=size(data.' VarName ',2);']); 451 eval(['nbcomponent1=size(data.' VarName ',1);']); 452 if numel(coord_x{icell})==2 453 coord_x{icell}=linspace(coord_x{icell}(1),coord_x{icell}(2),nbcomponent1); 454 end 455 if nbcomponent1==1|| nbcomponent2==1 456 legend_str=[legend_str {VarName}]; %variable with one component 457 else %variable with severals components 458 for ic=1:min(nbcomponent1,nbcomponent2) 459 legend_str=[legend_str [VarName '_' num2str(ic)]]; %variable with severals components 460 end % labeled by their index (e.g. color component) 461 end 462 end 463 end 464 if ~isempty(MinY) 465 MinY_cell(icell)=min(MinY); 466 MaxY_cell(icell)=max(MaxY); 438 if testplot(VarIndex(ivar)) 439 VarName=data.ListVarName{VarIndex(ivar)}; 440 nbplot=nbplot+1; 441 ytitle=[ytitle VarName]; 442 if isfield(data,'VarAttribute')&& numel(data.VarAttribute)>=VarIndex(ivar) && isfield(data.VarAttribute{VarIndex(ivar)},'units') 443 ytitle=[ytitle '(' data.VarAttribute{VarIndex(ivar)}.units '), ']; 444 else 445 ytitle=[ytitle ', ']; 446 end 447 eval(['data.' VarName '=squeeze(data.' VarName ');']) 448 MinY(ivar)=min(min(data.(VarName))); 449 MaxY(ivar)=max(max(data.(VarName))); 450 plotstr=[plotstr 'coord_x{' num2str(icell) '},data.' VarName ',' charplot_0 ',']; 451 eval(['nbcomponent2=size(data.' VarName ',2);']); 452 eval(['nbcomponent1=size(data.' VarName ',1);']); 453 if numel(coord_x{icell})==2 454 coord_x{icell}=linspace(coord_x{icell}(1),coord_x{icell}(2),nbcomponent1); 455 end 456 if nbcomponent1==1|| nbcomponent2==1 457 legend_str=[legend_str {VarName}]; %variable with one component 458 else %variable with severals components 459 for ic=1:min(nbcomponent1,nbcomponent2) 460 legend_str=[legend_str [VarName '_' num2str(ic)]]; %variable with severals components 461 end % labeled by their index (e.g. color component) 462 end 463 end 464 end 465 if ~isempty(MinY) 466 MinY_cell(icell)=min(MinY); 467 MaxY_cell(icell)=max(MaxY); 468 end 467 469 end 468 470 end -
trunk/src/set_object.m
r705 r729 578 578 % update the representation of all objects in view_field 579 579 for iobj=1:numel(UvData.ProjObject) 580 if isfield(UvData.ProjObject{iobj} .DisplayHandle,'view_field')580 if isfield(UvData.ProjObject{iobj},'DisplayHandle') && isfield(UvData.ProjObject{iobj}.DisplayHandle,'view_field') 581 581 UvData.ProjObject{iobj}.DisplayHandle.view_field=... 582 582 plot_object(UvData.ProjObject{iobj},UvData.ProjObject{iobj},UvData.ProjObject{iobj}.DisplayHandle.view_field,'b'); -
trunk/src/uvmat.m
r726 r729 3708 3708 list_path=get(handles.TransformName,'UserData'); 3709 3709 3710 %% handles uicontrol visibility3710 %% handles visibility of the path to the transform function 3711 3711 if isempty(transform_name) 3712 3712 set(handles.TransformPath,'Visible','off') … … 3714 3714 set(handles.TransformPath,'Visible','on') 3715 3715 end 3716 3717 3716 3718 3717 %% add a new item to the menu if the option 'more...' has been selected … … 3787 3786 if ~isempty(list_path{ichoice}) 3788 3787 if nargin(transform_handle)>1 && isfield(UvData,'XmlData')&&~isempty(UvData.XmlData) 3789 XmlData=UvData.XmlData{1};3790 DataOut=feval(transform_handle,'*', XmlData);3788 %XmlData=UvData.XmlData{1}; 3789 DataOut=feval(transform_handle,'*',UvData.XmlData{1}); 3791 3790 if isfield(DataOut,'CoordUnit')% set the requested coord unit (info used to possibly delete the current projection objects) 3792 3791 CoordUnit=DataOut.CoordUnit; … … 3795 3794 UvData.InputFieldType=DataOut.InputFieldType; 3796 3795 end 3797 if isfield(DataOut,'XmlData')% used to add transform parameters at selection of the transform fct 3798 ListFields=fieldnames(DataOut.XmlData); 3799 for ilist=1:numel(ListFields) 3800 UvData.XmlData{1}.(ListFields{ilist})=DataOut.XmlData.(ListFields{ilist}); 3801 end 3802 end 3803 else 3804 DataOut=feval(transform_handle,'*'); 3796 if isfield(DataOut,'TransformInput')% used to add transform parameters at selection of the transform fct 3797 UvData.XmlData{1}.TransformInput=DataOut.TransformInput; 3798 % ListFields=fieldnames(DataOut.XmlData); 3799 % for ilist=1:numel(ListFields) 3800 % UvData.XmlData{1}.(ListFields{ilist})=DataOut.XmlData.(ListFields{ilist}); 3801 % end 3802 end 3803 % else 3804 % DataOut=feval(transform_handle,'*'); 3805 3805 end 3806 3806 end … … 4260 4260 IndexObj=get(handles.ListObject,'Value');%present object selection 4261 4261 UvData=get(handles.uvmat,'UserData'); 4262 if numel(UvData.ProjObject)<IndexObj 4263 return 4264 end 4262 4265 ObjectData=UvData.ProjObject{IndexObj}; 4263 4266 ZBounds=0; % default … … 4546 4549 end 4547 4550 UvData.ProjObject(IndexObj)=[]; 4551 end 4548 4552 if ~isempty(list_str) 4549 4553 list_str(IndexObj)=[]; 4550 4554 end 4551 end4555 % end 4552 4556 set(huvmat,'UserData',UvData); 4553 4557 set(hlist_object,'String',list_str)
Note: See TracChangeset
for help on using the changeset viewer.