mne-connectivity icon indicating copy to clipboard operation
mne-connectivity copied to clipboard

Different text color for node names in plot_connectivity_circle() function

Open mahirtazwar opened this issue 1 year ago • 1 comments
trafficstars

Is it possible to add different text colors to each node name when plotting with mne_connectivity.viz.plot_connectivity_circle() function, similar to the node_colors parameter. For example, I would like to represent the node names that has significant connections with textcolor='black', and textcolor='gray' for those without any significant connections. Currently, only a single textcolor is supported.

I have also tried using the matplotlib.axes.Axes.tick_params() function to change the tick colors, but it does not work (despite not showing any errors).


fig, axes = plt.subplots(figsize=(10,10), facecolor='w', subplot_kw=dict(polar=True))

gFig, gAx = plot_connectivity_circle(conmat,
                             list(df),
                             node_colors=dmap.nodecolor,
                             node_angles=node_angles,
                             facecolor='w',
                             textcolor='k',
                             fontsize_names=10,
                             colormap='hot',
                             node_edgecolor='w',
                             ax=axes, show=False)

# Both the following option do not work
axes.tick_params(axis='both', labelcolor='red')
gAx.tick_params(axis='both', labelcolor='red')

I have currently resorted to using image editing software (e.g., Inkscape) to do this trick, but let me know if it is possible to represent the node name texts in different color with python code.

mahirtazwar avatar Jan 30 '24 19:01 mahirtazwar

Sure, a PR with a unit-test is welcome!

adam2392 avatar Mar 25 '24 21:03 adam2392