0todd0000 / spm1dmatlab

One-Dimensional Statistical Parametric Mapping in Matlab.
GNU General Public License v3.0
28 stars 13 forks source link

Modifying visualization layout #192

Closed drym1989 closed 6 months ago

drym1989 commented 10 months ago

Hi Todd,

I've been working on improving the visualization of our statistical results and have noticed that the p-value box, alpha, and F-statistics are somewhat overlapping, which might cause interference in the readability of the output.

I was wondering if it's possible to make some adjustments to the layout to enhance clarity. Specifically, I'd like to explore the option of removing or relocating the p-value box, alpha, and F-statistics to prevent any overlap. In addition, if it is possible to change the linewidth of the critical threshold.

A code snippet in MATLAB would certainly help.

Thank you in advance!

0todd0000 commented 10 months ago

The current version of spm1d unfortunately supports just basic plotting with very little customization. In order to customize things like text box position and line properties it would be best to develop a custom solution. To get started I recommend referring to Plotter.m where the plotting source code is contained. The plot_p_values method in particular could be modified in arbitrary ways. I nevertheless recommend developing this customization outside of the spm1d source code because changes to the source code cannot be supported in this forum. A customization could look something like this:

cluster   = spmi.clusters{1};   % first cluster object
ps        = sprintf('p = %.03f', cluster.P);  % p-value as a string
xy        = cluster.xy;  % cluster centroid
xy_offset = [0 0];  % offset from centroid
h         = text(xy(1)+xy_offset(1), xy(2)+xy_offset(2), ps);
set(h, 'HorizontalAlignment','center', 'BackgroundColor', 0.7*[1 1 1])