File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed
Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -104,5 +104,5 @@ venv.bak/
104104.mypy_cache /
105105
106106notebooks /my-first-scatter.html
107- Untitled.ipynb
107+ Untitled * .ipynb
108108gapminder_gdp_americas.csv
Original file line number Diff line number Diff line change 3232 " py.init_notebook_mode(connected=False)"
3333 ]
3434 },
35+ {
36+ "cell_type" : " markdown" ,
37+ "metadata" : {},
38+ "source" : [
39+ " People using Colab need this (initialization and download of supporting materials)"
40+ ]
41+ },
42+ {
43+ "cell_type" : " code" ,
44+ "execution_count" : null ,
45+ "metadata" : {},
46+ "outputs" : [],
47+ "source" : [
48+ " # Stuff for Colab ...\n " ,
49+ " import sys\n " ,
50+ " def enable_plotly_in_cell():\n " ,
51+ " import IPython\n " ,
52+ " from plotly.offline import init_notebook_mode\n " ,
53+ " display(IPython.core.display.HTML('''\n " ,
54+ " <script src=\" /static/components/requirejs/require.js\" ></script>\n " ,
55+ " '''))\n " ,
56+ " init_notebook_mode(connected=False)\n " ,
57+ " \n " ,
58+ " if 'google.colab' in sys.modules:\n " ,
59+ " get_ipython().events.register('pre_run_cell', enable_plotly_in_cell)\n " ,
60+ " !mkdir -p data\n " ,
61+ " !wget -P data https://raw.githubusercontent.com/ualberta-rcg/python-plotting/master/notebooks/data/gapminder_gdp_europe.csv"
62+ ]
63+ },
3564 {
3665 "cell_type" : " markdown" ,
3766 "metadata" : {},
357386 "metadata" : {},
358387 "outputs" : [],
359388 "source" : [
389+ " # Some versions will prefer `z=df.to_numpy()` below\n " ,
390+ " \n " ,
360391 " data = [\n " ,
361392 " go.Heatmap(\n " ,
362393 " x=years,\n " ,
363394 " y=df.index,\n " ,
364395 " z=df,\n " ,
396+ " colorscale='Jet'\n " ,
365397 " )\n " ,
366398 " ]\n " ,
367399 " layout = go.Layout(\n " ,
468500 " y=df.index,\n " ,
469501 " z=df,\n " ,
470502 " hoverinfo='text',\n " ,
471- " text=hovertext\n " ,
503+ " text=hovertext,\n " ,
504+ " colorscale='Jet'\n " ,
472505 " )\n " ,
473506 " ]\n " ,
474507 " layout = go.Layout(\n " ,
493526 " x=years,\n " ,
494527 " y=df_sorted.index,\n " ,
495528 " z=df_sorted,\n " ,
529+ " colorscale='Jet'\n " ,
496530 " )\n " ,
497531 " ]\n " ,
498532 " layout = go.Layout(\n " ,
You can’t perform that action at this time.
0 commit comments