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

Small refactor of plotting #539

Merged
merged 6 commits into from
Dec 3, 2024
Merged

Small refactor of plotting #539

merged 6 commits into from
Dec 3, 2024

Conversation

jnsbck
Copy link
Contributor

@jnsbck jnsbck commented Dec 3, 2024

Fixes #465 and refactors some plotting functionality.
Changes:

  • rm morph_plot_kwargs, rely on **kwargs instead.
  • renamed kwarg "col" -> "color" for consistency with pyplot.
  • Refactor Network.vis
  • cleanup of code (use new View functionality) and removal of unnecessary kwargs
  • rm _to_graph since it is obsolete now (replaced by scatter, which might be not as nice as the graph plotting, can be added back in though.). Since networkx is not used currently, this could also be removed as a dependency (until Add support for graph operations #355 makes it in at least)
  • disentangle moving and visualizing of cells, by adding arrange_in_layers. I think this is more clear and seperates out the additional kwargs of vis.

To get the same as net.vis(layers=[3,3]) one now has to do.

net.arrange_in_layers([3,3])
net.vis()

This now also works for both detail="full" and detail="point" and even for dims=[0,1,2] (not that this would be necessary). In general network.vis should feel more similar to cell.vis.

@jnsbck jnsbck changed the title Fix plotting kwargs Small refactor of plotting Dec 3, 2024
@jnsbck
Copy link
Contributor Author

jnsbck commented Dec 3, 2024

I think we can ignore regression tests not passing. they will get an update see #540, which should make it less annoying to get them to pass.

Copy link
Contributor

@michaeldeistler michaeldeistler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, all looks good!

@jnsbck
Copy link
Contributor Author

jnsbck commented Dec 3, 2024

fyi @kyralianaka in case you are using this.

@jnsbck jnsbck merged commit a22ee42 into main Dec 3, 2024
1 of 2 checks passed
@jnsbck jnsbck deleted the fix_plotting_kwargs branch December 3, 2024 17:58
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

Successfully merging this pull request may close these issues.

Inconsistent use of Dict and **kwargs for plotting functions [Bug]
2 participants