sccn / PACTools

EEGLAB plug-in to compute Phase-Amplitude Coupling using different methods
36 stars 9 forks source link

Potentially incorrect way to plot the significance mask in "comodulogram.m" #11

Closed CloudyDory closed 3 years ago

CloudyDory commented 3 years ago

Hi, thank you for making the PACTools first, it is a great EEGLAB extension!

However, I found two problems when plotting the significance mask in "comodulogram.m" on MATLAB R2020b.

  1. On line 44, linkaxes([haxes,haxes2]); will set the axis limit to the minimum and maximum limit of the two axes. For example, if the xLim of haxes is [4,15], and the xLim of the newly created haxes2 is [0,1], then linkaxes will set the axes limit to [0,15] (at least on MATLAB R2020b), which is not our goal. I suggest directly setting the axes limit of haxes2 according to haxes. For example: set(haxes2,'XLim',get(haxes,'XLim')); set(haxes2,'YLim',get(haxes,'YLim'));
  2. On line 45, the significant mask is plotted as: h_trans = pcolor(freqs_amp,freqs_phase,int8(g.signifmask), 'parent', haxes2); This looks strange to me because the x-axis and y-axis are flipped. According to the way to plot PAC values on line 18, I guess it should be changed to: h_trans = pcolor(freqs_phase,freqs_amp,int8(g.signifmask'), 'parent', haxes2);

Best, Zhou

nucleuscub commented 3 years ago

Hi @CloudyDory , Thanks for submitting the report. See comments below.

  1. Regarding the first report. This is fine the way it is. The function linkaxis is not used to set limits, in every instance, haxes and haxes2 will have the same dimensions. So nothing to do here...
  2. Here there was indeed an issue from a previous update to flip the x-axes in the comodulogram. It should be fine now. Note your solution needed a transpose to fit the dimensions. Thanks, Ramon