Back to the main page.

Bug 2031 - fieldtrip menu item is added multiple times

Reported 2013-03-06 11:48:00 +0100
Modified 2014-01-29 13:28:44 +0100
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Eelke Spaak
Depends on:
See also:

Robert Oostenveld - 2013-03-06 11:48:19 +0100

Created attachment 434 screenshot of figure The following code cfg = []; cfg.xlim = [-0.2 : 0.1 : 1.0]; % Define 12 time intervals cfg.zlim = [-2e-13 2e-13]; % Set the 'color' limits. clf; ft_topoplotER(cfg,avgFIC); from the eventrelatedaveraging tutorial causes the FieldTrip menu item (in the figure) to be added multiple times (once per subplot).

Jörn M. Horschig - 2013-03-13 10:15:34 +0100

*** Bug 2048 has been marked as a duplicate of this bug. ***

Eelke Spaak - 2013-03-15 09:07:14 +0100

fixed in 7667. Note that I added the fix to topoTFR and topoER separately, as that is where the menu code was. Should this be moved to topoplot_common? Also, what should the behaviour be of the menu if subplots are used which refer to different data sets? Something to think about.

Robert Oostenveld - 2013-03-15 11:20:28 +0100

(In reply to comment #2) should we in that case do something like: - if the menu item exists when making the 2nd (or further) subplots, remove it or hide it? - or, if it detects that the plot is made in a subplot, then don't add it?

Eelke Spaak - 2013-03-15 13:10:47 +0100

(In reply to comment #3) Yes, I think it should be removed for subplots. But this is less trivial than it might seem: we *do* want the menu there in cases like this figure; ft_topoplotER(cfg, data); ... ft_topoplotER(cfg, data); so when there is a plotting call without a new figure. So we cannot simply check the tag associated with gcf.

Jim Herring - 2013-04-03 17:07:11 +0200

(In reply to comment #4) In case of subplots you could change the label (and handle) of the uimenu items to correspond to the subplot/dataset. In any case, perhaps it is worth adding the possibility to disable adding the menu (e.g. cfg.uimenu = 'no'). When creating custom figures (e.g. figure that interactively browses through TFRs of single events) that repeatedly calls ft_singleplotXXX the menu is added multiple times as well. It would be convenient if you can disable this through the cfg.

Eelke Spaak - 2013-05-29 09:33:41 +0200

bash-4.1$ svn commit ft_singleplotER.m ft_singleplotTFR.m ft_topoplotER.m ft_topoplotTFR.m private/topoplot_common.m test/test_bug2031.m Sending ft_singleplotER.m Sending ft_singleplotTFR.m Sending ft_topoplotER.m Sending ft_topoplotTFR.m Sending private/topoplot_common.m Adding test/test_bug2031.m Transmitting file data ...... Committed revision 8161.

Eelke Spaak - 2014-01-29 13:28:44 +0100

changing lots of bugs from resolved to closed.