wiheto / netplotbrain

A package to create simple 3D network visualizations on a brain.
Apache License 2.0
67 stars 7 forks source link

highlightnode argument does not highlight nodes #30

Closed silviafan closed 2 years ago

silviafan commented 2 years ago

From showcase_image.py:

netplotbrain.plot(template='MNI152NLin2009cAsym',
                  templatestyle='surface',
                  view='L',
                  nodes='./examples/example_nodes.tsv',
                  hemisphere=['R'],
                  nodescale=5,
                  edges='./examples/example_edges.tsv',
                  templatealpha=0.05,
                  title='Highlight results',
                  templatecolor='gray',
                  highlightlevel=0.9,
                  highlightnodes=[6, 8, 25, 29],
                  fig=fig, ax=ax,
                  nodecolorlegend=False,
                  nodesizelegend=False,)

image

In general, this happens when nodetype is 'circles' or 'spheres'.

wiheto commented 2 years ago

So it currently highlight the edges only when doing it that way. But not the nodes. I’m actually working on that part of the code right now and will add a fix to it.

Thanks for spotting!

21 apr. 2022 kl. 13:00 skrev Silvia Fanton @.***>:

 From showcase_image.py:

netplotbrain.plot(template='MNI152NLin2009cAsym', templatestyle='surface', view='L', nodes='./examples/example_nodes.tsv', hemisphere=['R'], nodescale=5, edges='./examples/example_edges.tsv', templatealpha=0.05, title='Highlight results', templatecolor='gray', highlightlevel=0.9, highlightnodes=[6, 8, 25, 29], fig=fig, ax=ax, nodecolorlegend=False, nodesizelegend=False,)

In general, this happens when nodetype is 'circles' or 'spheres'.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

wiheto commented 2 years ago

Sorry did not see you had selfassigned to fix it. Let me know if you want to fix it or not.

The problem seems to have been introduced when adding nodealpha as a consequence when adding the scatter plot and matplotlib as it prioritizes the alpha argument over the alpha specification in the color argument. So nodealpha needs to be set to None if the nodecolor is Nx4 in shape after calling highlightnodes.

But since I am working on highlightedges at the moment, do you want me to fix it?

silviafan commented 2 years ago

As you are on it already, you can fix that. I will self-assign something else, no problem!

wiheto commented 2 years ago

Okidokey. Seems like I have fixed it. Testing some other features and will be added when I next update github.