[FieldTrip] how to add legend to ft_multiplotER/ft_singleplotER?

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Tue May 24 08:33:38 CEST 2022

Hi Songhee,

According to the latest version of the code on: https://github.com/fieldtrip/fieldtrip/blob/master/ft_multiplotER.m there is no functional option cfg.showlegend in ft_multiplotER, neither is it mentioned in the function’s help. If you desire such functionality, please feel free to come up with a suggestion to change the code in a Pull Request. You can check the corresponding code in ft_singleplotER for inspiration. Note, however, that it may require some thought as to where to put the ‘legend’. I can imagine that it makes sense to show it in an ft_singleplotER, since this function produces just a single image on the screen, but I am not sure whether one would like to have a legend displayed in each of the N small subplots that are produced by ft_multiplotER. Not only because it leads to a large amount of redundant visual info, it’s probably also not readable to begin with.

Best wishes,

On 24 May 2022, at 00:23, Songhee Kim via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Hi FieldTrippers,

How can I show legend (for experiment conditions) when plotting using ft_multiplotER or ft_singleplotER?

For example, the figure generated by the following codes doesn't show a legend.
cfg = [];
cfg.channel = 'all';
cfg.xlim    = [0 1];
cfg.layout  = lay;
cfg.showlegend   = 'yes';
ft_multiplotER(cfg, ga_container.E, ga_container.A);

Songhee Kim, PhD
Postdoctoral Fellow
Department of Neurology
Medical College of Wisconsin
fieldtrip mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220524/ec74eee8/attachment.htm>

More information about the fieldtrip mailing list