Back to the main page.

Bug 3370 - Interactive use of ft_topoplotER and subplots

Status CLOSED WONTFIX
Reported 2017-11-14 18:31:00 +0100
Modified 2018-01-26 09:51:31 +0100
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P5 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Heidi Solberg Økland - 2017-11-14 18:31:15 +0100

I am doing some coherence analyses on speech and MEG data these days, and have two different kinds of speech signals that I use for the coherence analysis. I've been using ft_topoplotER to plot single-subject sensor-level data like this: subplot(2,1,1); ft_topoplotER(cfg, Coh1) subplot(2,1,2); ft_topoplotER(cfg, Coh2) The plots look fine and sensible, so that's not the issue. But today I wanted to use the mark-sensors-and-look-at-frequency-spectrum function (i.e. the interactive function), but it only worked for the bottom plot (Coh2)! When I tried marking and clicking on some sensors on the upper plot (Coh1) Matlab gives the following error: Error using ft_singleplotER (line 363) cfg.refchannel is a not present in the (selected) channels) Error in topoplot_common>select_singleplotER (line 1019) ft_singleplotER(cfg, data{:}); Error in ft_select_channel>select_channel_multiple (line 148) feval(funhandle, label, funargs{:}); Error in ft_select_range>evalCallback (line 332) feval(funhandle, funargs{:}, val, cmenulab); Error in ft_select_range (line 166) evalCallback(callback, userData.range); Error while evaluating figure WindowButtonDownFcn This seems like a bug - would be great if you could look into it! I'm using the latest version of FT.


Jan-Mathijs Schoffelen - 2017-11-17 08:40:30 +0100

Does this also happen if you do ft_topoplotER(cfg, coh1, coh2); ?


Jan-Mathijs Schoffelen - 2017-11-20 15:27:25 +0100

I tried to generate a function to replicate your problem, but I don't manage to do so. In particular, when I do subplot(2,1,1);ft_topoplotER(cfg, coh1) a new figure window is opened, rather than that the stuff is plotted as a subplot. This suggests that you are either using some hand-crafted data to avoid this, or that you are not using the most recent version of fieldtrip


Heidi Solberg Økland - 2017-11-20 16:37:31 +0100

(In reply to Jan-Mathijs Schoffelen from comment #1 and #2) You also need to call e.g. figure(1); hold on before calling subplot in order to replicate the error. Sorry! As for your previous comment - plotting two different coherence maps on the same topoplot doesn't work in my case, since the two coherence analyses I am plotting are computed using two different signals (auditory speech envelope and lip aperture, respectively). So then the refchannel is a mismatch for one of the coherence measures and I get an error: Error using ft_singleplotER (line 363) cfg.refchannel is a not present in the (selected) channels) I'm copying in my full plotting script here so that you can get a better idea of what I'm doing: figure(1); hold on cfg = []; cfg.parameter = 'cohspctrm'; cfg.xlim = [0.5 10]; cfg.zlim = [0 0.15]; cfg.layout = 'neuromag306all.lay'; cfg.showlabels = 'yes'; cfg.colorbar = 'yes'; cfg.style = 'straight'; % Auditory coherence, gradiometers cfg.refchannel = 'AudEnv'; cfg.channel = 'MEGGRAD'; subplot(2,1,1); title('Auditory coherence gradiometers - subj_x'); ft_topoplotER(cfg, AudCoh) % Lip coherence, gradiometers cfg.refchannel = 'LipEnv'; cfg.channel = 'MEGGRAD'; subplot(2,1,2); title('Lip coherence gradiometers - subj_x'); ft_topoplotER(cfg, LipCoh)


Jan-Mathijs Schoffelen - 2017-11-21 09:18:29 +0100

with the current state of the code I don't manage to get 2 topo's in a single figure with subplots, the way you describe. Apparently, you are using an older version of the code, and the recent revamping of the code has got rid of this functionality. Please confirm that you use an older version of the code. I am not sure whether I want to spend time in getting this functionality 'back'. It was not in the design of the functions that it should work to begin with, and it seems to me that two separate figures would be also fine for exploration


Jan-Mathijs Schoffelen - 2017-11-23 14:23:40 +0100

Hi Heidi, Any update on this? I think that we should consider closing this bug, if you agree that with the current code we cannot even reproduce the issue


Jan-Mathijs Schoffelen - 2017-11-27 10:49:46 +0100

Closing, due to lack of user input. Please reopen if this can be constructively resolved, which at the moment does not seem to be the case.


Jan-Mathijs Schoffelen - 2017-11-27 10:50:03 +0100

Taking this, to keep an eye on it.