Back to the main page.

Bug 871 - add axes to summary plot in ft_multiplotTFR

Reported 2011-08-16 19:42:00 +0200
Modified 2011-11-11 11:20:01 +0100
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Eliezer Kanal
Depends on:
See also:

Eliezer Kanal - 2011-08-16 19:42:34 +0200

Created attachment 119 Differences between current and proposed code I wanted to have scale bars on my TFR plots, so I modified the `ft_multiplotTFR.m` file to do so. Instead of using `ft_plot_matrix`, I added some code to create a new axes object and put the scale plot there. The effect can be seen in the attached "figures.pdf" file. One comment about the code: I switched from using `xas` and `yas` to using `data.time` and `freq` to enable the plot to reflect non-default `xlim` and `ylim` values.

Eliezer Kanal - 2011-08-16 19:42:53 +0200

Created attachment 120 code diff

Eelke Spaak - 2011-08-18 09:52:30 +0200

Elli, the diff you provide is not 100% OK :) I see two issues with it: - You explicitly use cfg.ylim, which might contain 'maxmin' as the default. Instead, ymin and ymax should be used (which are assigned somewhere early on in the function). - You put the scale plot at a hard-coded location, whereas this should be positioned according to the layout file. I can see some code apparently related to this, but then many of the variables (xas_pos, yas_pos, and some others) remain unused.

Eliezer Kanal - 2011-08-18 22:54:34 +0200

The second problem is actually somewhat difficult, as it involves placing a subaxes in a figure using the `axis image` positioning scheme. I'll play around with it and hopefully I'll find a solution. If not, well, I guess I'll just keep using it just for my plots :)

Eelke Spaak - 2011-08-25 10:02:47 +0200

Since you are now an official contributor; go ahead and fix&commit it yourself :)

Eliezer Kanal - 2011-10-10 18:32:57 +0200

Created attachment 159 minimal working example of dynamically-positioned subaxis So, I've tried to fix the second point you mention, but I wasn't able to get it to work reliably. I was working with the following: - Question here: - Answer here: However, it seems that some of the manipulations we're doing to the axes at different points in the function cause this to not work appropriately. Specifically, in my testing, I've noticed that if you make any call to `axes`, it may or may not change the visibility of the sub-axes. Because of this fickleness, I'm going to change this to "CLOSED WONTFIX". Given that this is a minor change I don't think that should be a problem anyway. If someone wants to try to play with this later I'm including a "minimal working example" using the code in the above question (mytest.m); adapting it to the `ft_multiplotTFR` function, though, may take some work.

Robert Oostenveld - 2011-11-11 11:20:01 +0100

I closed all bugs that were recently resolved.