grape icon indicating copy to clipboard operation
grape copied to clipboard

Getting figure to be inline

Open pnrobinson opened this issue 3 years ago • 2 comments

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)

pnrobinson avatar Oct 24 '22 14:10 pnrobinson

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?

LucaCappelletti94 avatar Oct 27 '22 08:10 LucaCappelletti94

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

pnrobinson avatar Oct 27 '22 14:10 pnrobinson