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

plotting multiple diagrams #125

Open
JFA-CT opened this issue Jul 26, 2022 · 1 comment
Open

plotting multiple diagrams #125

JFA-CT opened this issue Jul 26, 2022 · 1 comment

Comments

@JFA-CT
Copy link

JFA-CT commented Jul 26, 2022

Hi there,
Is there any way to plot two sankey diagrams in the same html? I'm trying to do a visual comparison so that the relative size of the lines are proportional (and thus both sankeys are comparable but still separate) to each other? Thanks for any tips.

@ricklupton
Copy link
Owner

Hi @JFA-CT assuming you are using ipysankeywidget to show the Sankey diagrams in a Jupyter notebook, you can set the scale of the diagrams by setting the SankeyWidget's scale attribute.

Something like

scale = 0.2  # SVG units per data unit
w = weave(...).to_widget()
w.scale = scale
w  # at end of a cell it gets displayed (or you can use IPython display(w) explicitly)

See example here (if you can ignore the part which is about setting custom node positions, and see where the scale is set)
https://nbviewer.org/github/ricklupton/ipysankeywidget/blob/master/examples/More%20examples.ipynb#Custom-layout

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