Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different text color for node names in plot_connectivity_circle() function #169

Open
mahirtazwar opened this issue Jan 30, 2024 · 1 comment

Comments

@mahirtazwar
Copy link

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.

@adam2392
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants