Skip to content

Commit

Permalink
Made Box element notebooks Python 3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Jun 4, 2017
1 parent e2df3ee commit 9079666
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions examples/elements/bokeh/Box.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
"source": [
"%%opts Box (line_width=5 color='red') Image (cmap='gray')\n",
"data = np.sin(np.mgrid[0:100,0:100][1]/10.0)\n",
"data[range(40, 60) + range(40,50), range(20, 40)+ range(70,80)] = -3\n",
"hv.Image(data) * hv.Box(-0.2, 0, 0.2 ) * hv.Box(-0, 0, (0.4,0.9) )"
"data[np.arange(40, 60), np.arange(20, 40)] = -1\n",
"data[np.arange(40, 50), np.arange(70, 80)] = -3 \n",
"hv.Image(data) * hv.Box(-0.2, 0, 0.25 ) * hv.Box(-0, 0, (0.4,0.9) )"
]
},
{
Expand All @@ -66,7 +67,7 @@
"source": [
"%%opts Box (line_width=5 color='purple') Image (cmap='gray')\n",
"data = np.sin(np.mgrid[0:100,0:100][1]/10.0)\n",
"data[range(30, 70), range(30, 70)] = -3\n",
"data[np.arange(30, 70), np.arange(30, 70)] = -3\n",
"hv.Image(data) * hv.Box(-0, 0, 0.25, aspect=3, orientation=-np.pi/4)"
]
}
Expand Down
7 changes: 4 additions & 3 deletions examples/elements/matplotlib/Box.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
"source": [
"%%opts Box (linewidth=5 color='red') Image (cmap='gray')\n",
"data = np.sin(np.mgrid[0:100,0:100][1]/10.0)\n",
"data[range(40, 60) + range(40,50), range(20, 40)+ range(70,80)] = -3\n",
"hv.Image(data) * hv.Box(-0.2, 0, 0.2 ) * hv.Box(-0, 0, (0.4,0.9) )"
"data[np.arange(40, 60), np.arange(20, 40)] = -1\n",
"data[np.arange(40, 50), np.arange(70, 80)] = -3 \n",
"hv.Image(data) * hv.Box(-0.2, 0, 0.25 ) * hv.Box(-0, 0, (0.4,0.9) )"
]
},
{
Expand All @@ -66,7 +67,7 @@
"source": [
"%%opts Box (linewidth=5 color='purple') Image (cmap='gray')\n",
"data = np.sin(np.mgrid[0:100,0:100][1]/10.0)\n",
"data[range(30, 70), range(30, 70)] = -3\n",
"data[np.arange(30, 70), np.arange(30, 70)] = -3\n",
"hv.Image(data) * hv.Box(-0, 0, 0.25, aspect=3, orientation=-np.pi/4)"
]
}
Expand Down

0 comments on commit 9079666

Please sign in to comment.