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

Enh: specify different properties for different views #27

Open
wiheto opened this issue Apr 11, 2022 · 1 comment
Open

Enh: specify different properties for different views #27

wiheto opened this issue Apr 11, 2022 · 1 comment

Comments

@wiheto
Copy link
Owner

wiheto commented Apr 11, 2022

From the example currently in the readme:

fig = plt.figure()
ax_m2 = fig.add_subplot(121, projection='3d')
netplotbrain.plot(template='MNI152NLin2009cAsym',
                  templatestyle='surface',
                  fig = fig,
                  ax = ax_m2,
                  view='A',
                  nodes=nodes,
                  nodesize='centrality_measure1',
                  nodecolor='red',
                  edges=edges)

ax_m2 = fig.add_subplot(122, projection='3d')
netplotbrain.plot(template='MNI152NLin2009cAsym',
                  templatestyle='surface',
                  fig = fig,
                  ax = ax_m2,
                  view='A',
                  nodes=nodes,
                  nodesize='centrality_measure2',
                  nodecolor='blue',
                  edges=edges)
plt.show()

We could make arguments be lists across views. So the above would be

netplotbrain.plot(template='MNI152NLin2009cAsym',
                  templatestyle='surface',
                  view=['A', 'A'],
                  nodes=nodes,
                  nodesize=['centrality_measure1', 'centrality_measure2'],
                  nodecolor=['red', 'blue'],
                  edges=edges)
plt.show()

Benfitis:

  • Less code for user to write
  • Less figure management by user.

Negatives:

  • All input arguments would have to be checked for this behaviour. (So quite a bit of work. Although the function get_frame_input could do most of the work, if modified.)
  • Breaks legend behaviour if multiple legends are needed (e.g. example above) unless there is some way to detect when a legend would needed to be repeated or not.
@wiheto
Copy link
Owner Author

wiheto commented Jul 1, 2022

Currently included for subtitles and templatestyles to test usability. Will add for a couple more kwargs but could be removed if legend problem cannot be solved.

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

1 participant