0

I am using jupyter-notebook to write some python code and generate figures. As I wanted to add tooltips on mouse hovering and other interactions with the generated graphs, I now use mpld3 to display the graph. However, as I have quite a lot of things to plot, I need to increase the figure size. So, I putfig = plt.figure(figsize=(20, 10)).

When I display with the standard way, I can see all the figure in my notebook (with horizontal sliders if I increase a bit more the figsize). But with the mpld3 display, the size of the zone where the figure is displayed seems to be fixed, and hence, I can only see the upper left part of my figure. There are no sliders or anything to increase the displaying zone size.

For example, this code generate a graphic, for which you will see only the upper left part:

fig = plt.figure(figsize=(20, 10))
plt.plot([3,1,4,1,5], 'ks-')
mpld3.display(fig)

Does anyone know how to deal with this ? That is, how to increase the default display zone size, in order to have bigger graphs ?

Thanks

Edit after comment: Here is a screenshot of how it is displayed on my machine... enter image description here

And I would like it to be displayed just as it is on yours ! So I guess the problem comes from elsewhere... do you have any idea of how to solve this ?

Thomas K
  • 39,200
  • 7
  • 84
  • 86
pip
  • 185
  • 2
  • 2
  • 12

1 Answers1

0

I hope I do understand your question correctly but in Ipython Notebooks you can only use excisting space and not flip the notebook into wide screen mode or alike. In my notebook the graphic is also displayed like you show.

However, there is an easy fix, simply reduce the figsize to for example (10, 5). The main idea with interactive plotting with mpld3 is that the user can zoom in to specific interesting details. For the presented example it would not make much sense but richer graphs are great to be explored interactively.

Philipp Schwarz
  • 18,050
  • 5
  • 32
  • 36