10

I'm using plotly==4.5.1 in a jupyter==1.0.0 notebook, python==3.7.4.

The same piece of code which previous showed this:

plotly success

Is now showing this, without having had any modifications:

plotly fail

Does anyone have any insights over why this might be? Is it something to do with plotly's online/offline modes?

For completeness, here is some example dummy data

df_heat = pd.DataFrame({'lat': {0: -62.884215, 1: -62.834226, 2: -62.811707, 3: -62.744564, 4: -62.704835},
 'lon': {0: 39.4402361, 1: 39.4080722, 2: 39.3804616, 3: 39.4891116, 4: 39.4243305},
 'count': {0: 1, 1: 1, 2: 1, 3: 1, 4: 1}})

And the code used to create the map.

import plotly.graph_objects as go

fig = go.Figure(go.Densitymapbox(lat=df_heat['lat'], lon=df_heat['lon'], z=df_heat['count'],
                                 radius=10,))
fig.update_layout(mapbox_style="carto-positron", mapbox_zoom=10, mapbox_center = {"lat": 40.7831, "lon": -73.9712},)

fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()

Update (before any answers were posted)

Restarting my computer seemed to solve this issue ¯\_(ツ)_/¯. Insight on why it happened would still be appreciated.

Ian
  • 3,605
  • 4
  • 31
  • 66
  • 4
    Were you using Chrome? Looks like a rendering process from within Chrome crashed (hence that odd icon). – miqh Feb 24 '20 at 23:55
  • This seems likely, any thoughts on why this could've occurred though? – Ian Feb 25 '20 at 15:04
  • 2
    I've had Plotly.js (I know it's completely unrelated to your use) do the same thing to me before—especially when defining a plot that makes use of WebGL (e.g. `scattergl`). Unfortunately, no clue as to the cause except that Chrome must simply be unhappy with what it has to render? – miqh Feb 25 '20 at 23:49
  • 4
    I've just had this when plotting mulitiple scatters (`for n,g in df.groupby`) -- if i limit it to the first 8 groups it's fine, but more than that and it starts to lose some. Will try the restart, but it appears to be a Chrome rendering/memory issue – BAC83 May 25 '21 at 07:58
  • I'm having the same issue. More than 8 scatter plots (huh??) causes the extra plots to show sad face – ceds Dec 07 '21 at 14:37
  • I also have the same issue with jupyter notebook using locally in Visual Studio Code in a for with 16 figures – Guilherme Parreira May 05 '23 at 13:38

0 Answers0