Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions examples/notebooks/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@
"# use an alpha value since this will be a lot of points\n",
"scatter_graphic = subplot_scatter.add_scatter(data=cloud, sizes=3, colors=colors, alpha=0.6)\n",
"\n",
"fig_scatter.show()"
"fig_scatter.show(sidecar=True)"
]
},
{
Expand Down Expand Up @@ -1536,12 +1536,40 @@
"outputs": [],
"source": [
"def update_points(subplot):\n",
" # move every point by a small amount\n",
" deltas = np.random.normal(size=scatter_graphic.data().shape, loc=0, scale=0.15)\n",
" scatter_graphic.data = scatter_graphic.data() + deltas\n",
" scatter_graphic.data = scatter_graphic.data() + deltas \n",
"\n",
"subplot_scatter.add_animations(update_points)"
]
},
{
"cell_type": "markdown",
"id": "1592c6cd-d10a-4bda-ac4b-e06d428ffa1d",
"metadata": {},
"source": [
"Another animation function to cycle the colors of one of the clouds"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fb0394a3-47d9-4620-a754-d04d5f313cc7",
"metadata": {},
"outputs": [],
"source": [
"i = 0.05\n",
"def cycle_colors(subplot):\n",
" global i\n",
" # cycle the red values\n",
" scatter_graphic.colors[n_points * 2:, 0] = np.abs(np.sin(i))\n",
" scatter_graphic.colors[n_points * 2:, 1] = np.abs(np.sin(i + (np.pi / 4)))\n",
" scatter_graphic.colors[n_points * 2:, 2] = np.abs(np.cos(i))\n",
" i += 0.05\n",
"\n",
"subplot_scatter.add_animations(cycle_colors)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -2020,7 +2048,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down