Why are Folium maps not displayed in Jupyter Notebooks - python

I want to display a simple map with Folium in Jupyter notebooks.
The code below (and as shown in the picture) should work in Jupyter notebooks, but instead of displaying a map I just get an empty space.
# define the world map
world_map = folium.Map()
# display world map
world_map
I already tried restarting the kernel and using different browsers (safari, chrome). I also made sure that no content blocker is active. But no difference.
Does anyone know what I need to do to be able to see the map?

With a little help from my friends I managed to find the root cause. The problem were the firewall settings in the router. Some servers, where the folium maps got their data from, were blacklisted. That's why the maps were not displayed.

Related

Dash/Plotly layout rendering differently on another computer after the deploy

I just deployed a dashboard on Google Cloud and shared it with a friend to check if he could access it. I asked for a screen print to check if everything was ok.
To my surprise, the dashboard that appeared to him is very different from what appears to me. On his screen, the text fonts are all misconfigured and the size of the graphics are different, in addition to not being centered on the screen.
I didn't think this problem would happen, since the dash is online on the internet.
Can anyone tell me how I can standardize the view for any user?
I don't know if it helps but all the layout code (html+css+python) is in the same app.py file.
Obs
There is no Go.figures or Bootstrap in my code. It's just simples plotly charts made with plotly.express.

minimize my nbconvert html output screen size

I searched a lot for this issue but didn't come to any straight to the point answer, so I am turning to you here and hopefully someone can help direct me to the right path at least.
The issue is simple, I have normal jupyter Nb and I would like to share it with others by sending them html format file. Using the normal !jupyter nbconvert --to html mynotebook.ipynbwill get the html export, but recently I started getting output with very wide screen (it uses the monitor screen).
How can I change the output screen size to maintain the same configurations even after exporting it to html?
In case my explanation wasn't clear I will add pictures:
notebook before exporting:
After exporting:
I don't want to create any special template, I just want to maintain the same parameters before exporting i.e. the width of the cells (inputs and outputs). Most of the answers I found here was talking about creating my own template or running some css code (both I don't have knowledge in...). Is there a ready to use template or argument that I can use to maintain the same layout?
I ran into the same issue. I think the problem might be that --to html uses the Jupyter Lab template by default. Once I added --template classic to my call to nbconvert the resulting HTML-file was much smaller and resembled the actual Jupyter notebook much more closely.

How to change HighCharts theme using Python ezhc?

I have been using ezhc package, it is a very useful tool to manipulate highcharts object using Python.
But I have desperately tried to change the themes of the Highcharts graph I am producing, based on the demo notebook found on Github link
Anything I have tried is unsuccessful, it seems that this part of the code, which should override globaloptions of all the charts, does not work as expected:
hc_global = hc.GlobalOptions(th.themes['dark-unica'])
hc_global.inject(verbose=True)
I see the js hc_global.js seems to be correctly created, but does not override the globalOptions of the chart. The visual of the chart output after is unchanged, no matter what theme is chosen
Am I doing something wrong? Does anybody successfully ran the example notebook and observed the theme change?
Thanks a lot for your help

Is it possible to redirect cell output in jupyter

I am using jupyter and jupyter-nbconvert to create a html presentation. However, I have some cells that produce an output image that I want to share on a separate slide. Is it possible to redirect the output of one cell to its own slide?
You might want to consider using Damian Vila's Jupyter extension RISE. It provides some of the control you need for how cells are displayed in slides.
It is flagged by the latest Jupyter (3.6) as possibly not compatible, but I've seen no problems using it so far.

Matplot lib image properties in web (Django)

I'd like to output the image to the web created in matplotlib having the very same functionality like it has on desktop when you run the image.show(), for example scaling, moving along the plot more thoroughly.
I've checked out #stack and got old post only offering static images or gif or matplotlib.animate()
I aslo had a look at matplotlib widgets, but those are for desktop GUI only as far as I can see.
Please share some experience or ideas regarding how can I achieve it.
Thanks
Matplotlib is a server side library so you cannot do anything on the client side like that.
The closest you can come is to either use mpld3 (mpld3 works by converting a matplotlib graph into the html/js that a d3 js graph would need to render) or a different client side library that plots points.
The easiest way of serving pure matplotlib to the web is using a jupyter notebook.
Other than that, you may want to look at specific libraries like Plotly or bokeh.

Categories

Resources