Search code examples
matlabmatlab-figureaxes

Error using matlab.graphics.axis.Axes/set?


I was running a script on my Laptop (Windows; using Matlab R2014a) and it ran perfectly. I now tried using the same script on a working PC (Linux Ubuntu; using Matlab R2017b) and I get the following error message:

Error using matlab.graphics.axis.Axes/set There is no YtickL property on the Axes class.

figure('units','normalized','outerposition',[0 0 1 1])
imagesc(SIG_ARR);
hold on
g_y=[0.5:1:24.5]; % user defined grid Y 
g_x=[0.5:1:8.5]; % user defined grid X 
for i=1:length(g_x)
  plot([g_x(i) g_x(i)],[g_y(1) g_y(end)],'k:') %y grid lines
  hold on    
end
for i=1:length(g_y)
  plot([g_x(1) g_x(end)],[g_y(i) g_y(i)],'k:') %x grid lines
  hold on     
end

colormap(parula);
set(gca, 'Ytick', [1:1:24.5]);
title('... EMG - EMG Coherence', 'FontSize', 24);
neworderX={'VL_ri' 'VL_le' 'VM_ri' 'VM_le' 'TA_ri' 'TA_le' 'ES_ri' 'ES_le'};
neworderY={'VL_ri_Down' 'VL_ri_Hold' 'VL_ri_Up' 'VL_le_Down' 'VL_le_Hold' 
'VL_le_Up' 'VM_ri_Down' 'VM_ri_Hold' 'VM_ri_Up' 'VM_le_Down' 'VM_le_Hold' 
'VM_le_Up' 'TA_ri_Down' 'TA_ri_Hold' 'TA_ri_Up' 'TA_le_Down' 'TA_le_Hold' 
'TA_le_Up' 'ES_ri_Down' 'ES_ri_Hold' 'ES_ri_Up' 'ES_le_Down' 'ES_le_Hold' 
'ES_le_Up'};
set(gca, 'YtickL', neworderY(:));
set(gca, 'XtickL', neworderX(:));

set(gcf, 'Position', get(0, 'Screensize'));
outfile=fullfile(outdir, '_EMG_EMG_COH_overview');
saveas(gcf,outfile,'fig'); 

I tried to find something on this error online, yet I could not come up with a working solution...It might have something to do with the difference in the two Matlab Versions I use. I hope you guys can help me out...

Cheers and thanks in advance!


Solution

  • Try to use XTickLabel and YTickLabel.