Skip to content

Commit 16f283a

Browse files
committed
Improve plotting example
1 parent a7a6b5e commit 16f283a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

examples/plotting.ipynb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,12 @@
128128
" # Draw scatter\n",
129129
" n_marks = min(x.shape[0], y.shape[0], size.shape[0], color.shape[0])\n",
130130
"\n",
131+
" canvas.stroke_style = stroke_color\n",
132+
"\n",
131133
" for idx in range(n_marks):\n",
132134
" canvas.begin_path()\n",
133135
"\n",
134136
" canvas.fill_style = colormap(color[idx])\n",
135-
" canvas.stroke_style = stroke_color\n",
136137
"\n",
137138
" canvas.arc(\n",
138139
" scale_x(x[idx]), scale_y(y[idx]),\n",
@@ -323,6 +324,19 @@
323324
"VBox((power_plot, slider))"
324325
]
325326
},
327+
{
328+
"cell_type": "code",
329+
"execution_count": null,
330+
"metadata": {},
331+
"outputs": [],
332+
"source": [
333+
"n = 1_000\n",
334+
"x = np.linspace(0, 100, n)\n",
335+
"y = np.cumsum(np.random.randn(n))\n",
336+
"\n",
337+
"line_plot(x, y, line_width=3)"
338+
]
339+
},
326340
{
327341
"cell_type": "markdown",
328342
"metadata": {},

0 commit comments

Comments
 (0)