Back to the main page.

Bug 2203 - font size is too small in ft_databrowser

Status CLOSED FIXED
Reported 2013-06-16 13:35:00 +0200
Modified 2019-08-10 12:32:57 +0200
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Roemer van der Meij
URL:
Tags:
Depends on: 2348
Blocks: 23142296
See also:

Roemer van der Meij - 2013-06-16 13:35:43 +0200

As title.


Roemer van der Meij - 2013-06-16 13:39:10 +0200

Fixed by adding an optional font units option to ft_plot_text and setting them to normalized in ft_databrowser with a relative font-size, when plotting y-axis channel labels.


Robert Oostenveld - 2013-09-30 14:22:32 +0200

there are more issues due to which channel labels don't scale nicely. I did load dataFIC cfg = [] cfg.method = 'pca' comp = ft_componentanalysis(cfg, dataFIC) cfg = [] ft_databrowser(cfg, comp) If I have a small figure (by default), the font is ok. If I stretch the figure, the font gets bigger. That is nice. If I then do arrow-down (i.e. display next 10 components) a redraw of the labels is done with a small font. Confusing. If I then resize the window to its original format, the labels scale down along with it, making them tiny. There is also bug 2065 which is related to this. I suggest we sit down do define the desired behaviour, and only then try to implement it accordingly.


Roemer van der Meij - 2013-09-30 15:11:46 +0200

That's odd, I can't replicate what you describe. In my case (same dataset), labels are resized when resizing the figure window, but not when scrolling through components. Back and forth resizing and the font follows. What matlab are you using? I'm on R2012B.


Robert Oostenveld - 2015-07-17 09:40:52 +0200

The original title of the bug was "ft_databrowser: y-axis labels don't scale nicely with viewmode = 'vertical'", but let me rename it to deal with it in general.


Robert Oostenveld - 2015-07-17 09:42:19 +0200

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


Robert Oostenveld - 2015-07-17 11:46:42 +0200

It would not surprise me that part of the font size issues are due to MATLAB version differences. I made some changes to improve the font size handling. At least the user now has some own choice. mac011> svn commit private/browse_topoplotVAR.m ft_movieplotTFR.m ft_databrowser.m Sending ft_databrowser.m Sending ft_movieplotTFR.m Sending private/browse_topoplotVAR.m Transmitting file data ... Committed revision 10555.


Jim Herring - 2015-08-04 08:50:46 +0200

This last enhancement to databrowser produces an error when using the on-the-fly cfg.preproc input box more than one time in a databrowser window: parent = get(h, 'parent'); cfg = getappdata(parent, 'cfg'); % parse cfg.preproc if ~isempty(cfg.preproc) tmpcfg = cfg.preproc; cfg = []; cfg.preproc = tmpcfg; code = printstruct('cfg', cfg); else code = ''; end As soon as this happens a new cfg is created. Later in the code cfg.editfontsize and cfg.editfontunits are called, which do not exist anymore at this level: set(ppeh, 'FontName', 'Courier', 'FontSize', cfg.editfontsize, 'FontUnits', cfg.editfontunits); I have now fixed this by assigning both font options to new variables before the cfg is overwritten: editfontsize = cfg.editfontsize; editfontunits = cfg.editfontunits; set(ppeh, 'FontName', 'Courier', 'FontSize', editfontsize, 'FontUnits', editfontunits); Sending ft_databrowser.m Transmitting file data . Committed revision 10569.


Roemer van der Meij - 2016-03-03 14:54:00 +0100

This is still annoying. I'll do something on this soon. Multiple efforts failed so far. This had partially to do with different matlab versions dealing with font size in different ways, and different use-cases where didn't think well enough and edited back and forth. I'll have another go at this. I'll use an estimation of appropriate font sizes, with a hard minimum. If names are overlapping, I'll cut some of them out. As such, I've added bug 2348 to this, to enable identify channel in vertical mode (when nchan>100 a necessary feature anyway). It will not be ideal in all cases, which is something we'll have to accept (together with the identify function). Now it's broken in a lot of cases, my goals is to get to a higher number of fixed cases. I'll test and post some pictures as well.


Roemer van der Meij - 2016-05-10 01:39:43 +0200

Alright, I think I FINALLY have decent solution for this. Robert/JM/others, could you checkout the following branch and see whether you agree/disagree? (no pull request yet) https://github.com/roemervandermeij/fieldtrip/tree/bugfix2203 Here's what's the default in the above: - channel labels are now always plotted as 12 point font - cfg.plotlabels = 'some' by default - all labels have y-ticks - how many labels will be plotted is adaptive w.r.t. to window size (this is done using windows size in pixels, which should be robust) The result is that when people plot with cfg.viewmode = vertical for the first time, channels labels will (likely) always be non-overlapping and be at readable font size. If the window is big enough, all labels will be plotted. All user options using cfg.plotlabels = 'yes', cfg.fontunits/size, and defaults (like y ticks) are left intact. We could implement it as such, but without defaulting to the above. But, I think with this we will capture the largest amount of users possible, making the defaulting reasonable. Let me know what you think...


Roemer van der Meij - 2016-05-12 22:07:44 +0200

Merged, closing bug again.


Robert Oostenveld - 2019-08-10 12:32:57 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on https://github.com/fieldtrip/fieldtrip/issues.