[FieldTrip] plot ft_sourceplot figures into a subplot

Robert Oostenveld r.oostenveld at donders.ru.nl
Tue May 8 16:53:21 CEST 2018


Dear Hame

ft_sourceplot is a high-level function that includes interaction with the data (i.e. clicking). Furthermore, depending on method (ortho/surface/montage/glassbrain/cloud) you will get one or mutliple sub-axes within one figure. So it is not suited for use in a loop with multiple axes or subplots.

I know that people are using it to export images to pdf/ps or ai format and then use external software to glue them together. I also find it convenient to save the figures to a bitmap using “print -dpng” and use external software (such as Windows picture viewer) to browse through large numbers of files. I believe this is also mentioned somewhere on http://www.fieldtriptoolbox.org/tutorial/plotting <http://www.fieldtriptoolbox.org/tutorial/plotting>

If you want closer control over the figures and different axes within one figure, I recommend you use the lower-level plotting functions that you can find in fieldtrip/plotting. E.g. ft_plot_mesh <http://www.fieldtriptoolbox.org/reference/ft_plot_mesh>, which you can give the mesh and the colors you want on each of the vertices or triangles. See also http://www.fieldtriptoolbox.org/reference#from_the_plotting_module <http://www.fieldtriptoolbox.org/reference#from_the_plotting_module>


best regards,
Robert

PS please use the fieldtrip mailing list next time, there are many people on it that can help, and providing answers on the list benefits others as well


> On 27 Apr 2018, at 14:20, Hame Park <hame.hame.hame at gmail.com> wrote:
> 
> Dear Robert
> 
> Hello!
> I was trying to make a big figure with many
> sourceplots, created from ft_sourceplot with the 'surface' method,
> but it seems it always creates a separate figure.
> 
> I tried something like
> 
> h = figure;
> ha = nan(length(T), 1);
> for t=1:length(T)
>     ha(t) = subplot(1, length(T), t);
> end
> 
> for t=1:length(T)
>     axes(ha(t))
>     ft_sourceplot(cfg, data)
> end
> 
> but it still opens up a new figure for ft_sourceplot.
> I tried to look into the code, and tried disabling the line
> h=figure; but this gave me errors which I couldn't comprehend.
> 
> Any help would be much appreciated!
> 
> Thank you.
> Best wishes,
> Hame

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180508/61cae64d/attachment.html>


More information about the fieldtrip mailing list