Skip to content

Commit

Permalink
Merge pull request #181 from martinRenou/fix_ipycanvas
Browse files Browse the repository at this point in the history
Fix ipycanvas Notebooks
  • Loading branch information
mwcraig authored Jun 17, 2022
2 parents 60ac8fa + 5e90c97 commit 2cb282e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions notebooks/07.More-libraries/07.01-ipycanvas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@
" self.scheme = scheme if scheme is not None else self.scheme\n",
"\n",
" padding = 0.1\n",
" padding_x = padding * self.size[0]\n",
" padding_y = padding * self.size[1]\n",
" padding_x = padding * self.width\n",
" padding_y = padding * self.height\n",
"\n",
" self.drawarea = (drawarea_min_x, drawarea_min_y, drawarea_max_x, drawarea_max_y) = (padding_x, padding_y, self.size[0] - 2 * padding_x, self.size[1] - 2 * padding_y)\n",
" self.drawarea = (drawarea_min_x, drawarea_min_y, drawarea_max_x, drawarea_max_y) = (padding_x, padding_y, self.width - 2 * padding_x, self.height - 2 * padding_y)\n",
"\n",
" min_x, min_y, max_x, max_y = np.min(x), np.min(y), np.max(x), np.max(y)\n",
"\n",
Expand Down Expand Up @@ -393,7 +393,7 @@
" canvas.fill_style = '#FFF0C9'\n",
" canvas.stroke_style = 'white'\n",
" canvas.rough_fill_style = 'solid'\n",
" canvas.fill_rect(-10, -10, canvas.size[0] + 10, canvas.size[1] + 10)\n",
" canvas.fill_rect(-10, -10, canvas.width + 10, canvas.height + 10)\n",
" canvas.rough_fill_style = 'cross-hatch'\n",
"\n",
" canvas.fill_style = color\n",
Expand Down Expand Up @@ -428,7 +428,7 @@
"canvas = RoughCanvas(width=x.shape[0]*n_pixels, height=x.shape[1]*n_pixels)\n",
"canvas.fill_style = '#FFF0C9'\n",
"canvas.stroke_style = 'white'\n",
"canvas.fill_rect(0, 0, canvas.size[0], canvas.size[1])\n",
"canvas.fill_rect(0, 0, canvas.width, canvas.height)\n",
"\n",
"draw(x, canvas, '#5770B3')\n",
"\n",
Expand Down

0 comments on commit 2cb282e

Please sign in to comment.