17

I'm doing a bit of choropleth map plotting in a Jupyter notebook (with Folium), and I was just wondering if there's any way of making an output cell fullscreen? It would just make the map a bit easier to view. If not, is there an easy way of modifying the maximum height of an output cell?

2
  • I think you best bet would be to use a custom jinja2 template and a function that will create the map and a link in the notebook to an html document created with the custom jinja2 template. The jinja2 template could have a 100% width and height map. Commented Feb 24, 2016 at 9:48
  • You could try to capture the output (plots, maps, table, number, ...) in python, convert it to HTML code, and write it to a new window using javascript. This strategy works like a charm for Pandas dataframe tables, but I am not sure about plotted maps... Commented Nov 30, 2016 at 1:17

5 Answers 5

16

Try this:

    from IPython.core.display import display, HTML
    display(HTML("<style>.container { width:100% !important; }</style>"))
Sign up to request clarification or add additional context in comments.

1 Comment

IPython.core.display has been deprecated since IPython 7.14; instead, use from IPython.display import display, HTML.
6

I wrote a Jupyter extension that let's a cell go fullscreen here. Installation instructions are on this Github page.

The heart of the extension is just making a selected element (a Jupyter cell) go fullscreen with this code:

function toggleFullscreen(elem) { //function to make element (cell) fullscreen on most browsers
  elem = elem || document.documentElement;
  if (!document.fullscreenElement && !document.mozFullScreenElement &&
    !document.webkitFullscreenElement && !document.msFullscreenElement) {
    if (elem.requestFullscreen) {
      elem.requestFullscreen();
    } else if (elem.msRequestFullscreen) {
      elem.msRequestFullscreen();
    } else if (elem.mozRequestFullScreen) {
      elem.mozRequestFullScreen();
    } else if (elem.webkitRequestFullscreen) {
      elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
    }
  } else {
    if (document.exitFullscreen) {
      document.exitFullscreen();
    } else if (document.msExitFullscreen) {
      document.msExitFullscreen();
    } else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen();
    } else if (document.webkitExitFullscreen) {
      document.webkitExitFullscreen();
    }
  }
}

Please see the Github page for the entirety of the code.

Comments

2

I'm currently using Chrome, I figured out that just click

F12 -> F11 -> F12

and then you get full screen mode. Click F11 if you want to get out of the full screen mode. I believe this method works because when you press F12, you access DevTool mode, where the F11 key is operational.

While this approach doesn't inherently extend the width of the cell, it does facilitate activating Chrome's full-screen mode. By adjusting the zoom level and selecting a suitable font size, you can create the illusion that the cell occupies the entire screen, enhancing its visual integration.

Comments

1

IPython.core.display is deprecated since IPython 7.14

from IPython.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))

3 Comments

This answer seems to be building upon Toddneal Stallworth's answer, so it may be more accessible to other users if you edit that post instead.
I tried @Score_Under, but unfortunately, the suggestion queue is full ... :/ That is why I posted the update as an 'answer.' I'm a StackOverflow newbie. If you have another idea, I will be pleased to try :)
That's okay, stack overflow is like that sometimes :/ I don't think there's a good solution to that
-1

Click F11, to view the Jupyter Notebook in Full Screen Mode. Click F11 once more, to come out of Full Screen Mode.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.