AnacletoLAB / grape

🍇 GRAPE is a Rust/Python Graph Representation Learning library for Predictions and Evaluations
MIT License
502 stars 38 forks source link

Getting figure to be inline #24

Open pnrobinson opened 1 year ago

pnrobinson commented 1 year ago

matplotlib plots figures inline by default or if we write

%matplotlib inline

Some of the figures produced by GRAPE get put into "subwindows" in the Jupyter notebook, and one needs to scroll up and down to see the entire figure. GRAPE does not seem to be responsive to the inline magic command above either.

For instance, in order for a certain figure to really appear online, I need to make it much smaller

visualizer = GraphVisualizer(sli_graph, automatically_display_on_notebooks=False)
fig, ax, cap = visualizer.plot_node_degree_distribution()
fig.set_figheight(3)
fig.set_figwidth(3)

even though the notebook could comfortably show (5,5) or even (8,8)

LucaCappelletti94 commented 1 year ago

Hello Peter,

You can provide to the method the figure and axes to be used, so you can arbitrarily set them up beforehand or alternatively edit them afterwards as you are already doing.

I'm not sure how the %matplotlib inline works, but in the visualization, we use matplotlib directly without any fancy thing mixed up.

Maybe we can plan a short call to tackle the issue?

pnrobinson commented 1 year ago

No worries, let's touch bases next week, I am at the ASHG this week