Changeset 1101 for trunk/src/uvmat.m


Ignore:
Timestamp:
May 5, 2021, 11:44:05 PM (3 years ago)
Author:
sommeria
Message:

colobar for vectro color copied during fig exportation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r1100 r1101  
    595595hc=copyobj(handles.PlotAxes,hfig);
    596596set(hc,'Position',[0.1 0.1 0.8 0.8])
     597title_menu=get(handles.FieldName,'String');
     598title_string=title_menu{get(handles.FieldName,'Value')};
     599title(title_string);
    597600h=findobj(handles.PlotAxes,'tag','ima'); %look for image in the plot
    598601if ~isempty(h)
     
    601604    colorbar
    602605end
     606%% copy the colormap of the vector color if relevant
     607if strcmp(get(handles.Vectors,'Visible'),'on')
     608    color_menu=get(handles.ColorCode,'String');
     609    color_mode=color_menu{get(handles.ColorCode,'Value')};
     610    if ~(strcmp(color_mode,'black')||strcmp(color_mode,'white'))
     611        hveccolor=axes('Position',[0.93 0.1 0.02 0.5]);
     612        ima=permute(get(handles.VecColBar,'CData'),[2 1 3]);
     613        ymin=str2num(get(handles.num_MinVec,'String'));
     614        ymax=str2num(get(handles.num_MaxVec,'String'));
     615        set(hveccolor,'YLim',[ymin ymax])
     616        imagesc([0 1],[ymin ymax],ima)
     617        set(hveccolor,'YDir','normal')
     618        set(hveccolor,'YAxisLocation', 'right')
     619        set(hveccolor,'XTickLabel','')
     620        scalar_menu=get(handles.ColorScalar,'String');
     621        scalar_title=scalar_menu{get(handles.ColorScalar,'Value')};
     622        htitle=get(hveccolor,'Title');
     623        set(htitle,'String',scalar_title)
     624    end
     625end
     626
    603627
    604628% --------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.