diff --git a/examples/elements/bokeh/Box.ipynb b/examples/elements/bokeh/Box.ipynb index 3f9fb9c25d..2de91ee7f3 100644 --- a/examples/elements/bokeh/Box.ipynb +++ b/examples/elements/bokeh/Box.ipynb @@ -30,7 +30,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "A ``Box`` is an annotation that takes a center x-position, a center y-position and a width:" + "A ``Box`` is an annotation that takes a center x-position, a center y-position and a size:" ] }, { @@ -41,17 +41,19 @@ }, "outputs": [], "source": [ - "%%opts Box (line_width=5 color='purple') Image (cmap='gray')\n", + "%%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(30, 70), range(30, 70)] = -3\n", - "hv.Image(data) * hv.Box(-0, 0, 0.5 )" + "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) )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "In addition to these arguments, it supports an optional ``aspect ratio``:" + "In addition to these arguments, it supports an optional ``aspect ratio``:\n", + "\n", + "By default, the size argument results in a square such as the small square shown above. Alternatively, the size can be given as the tuple ``(width, height)`` resulting in a rectangle. If you only supply a size value, you can still specify a rectangle by specifying an optional aspect value. In addition, you can also set the orientation (in radians, rotating anticlockwise):" ] }, { @@ -63,7 +65,9 @@ "outputs": [], "source": [ "%%opts Box (line_width=5 color='purple') Image (cmap='gray')\n", - "hv.Image(data) * hv.Box(-0, 0, 0.25, aspect=3)" + "data = np.sin(np.mgrid[0:100,0:100][1]/10.0)\n", + "data[range(30, 70), range(30, 70)] = -3\n", + "hv.Image(data) * hv.Box(-0, 0, 0.25, aspect=3, orientation=-np.pi/4)" ] } ], diff --git a/examples/elements/bokeh/Ellipse.ipynb b/examples/elements/bokeh/Ellipse.ipynb index c83c64c749..3e9ffcc6d5 100644 --- a/examples/elements/bokeh/Ellipse.ipynb +++ b/examples/elements/bokeh/Ellipse.ipynb @@ -7,8 +7,8 @@ "
\n", "
\n", "
Title
Ellipse Element
\n", - "
Dependencies
Matplotlib
\n", - "
Backends
[Matplotlib](./Ellipse.ipynb)
[Bokeh](../bokeh/Ellipse.ipynb)
\n", + "
Dependencies
Bokeh
\n", + "
Backends
[Bokeh](./Ellipse.ipynb)
[Matplotlib](../matplotlib/Ellipse.ipynb)
\n", "
\n", "
" ] @@ -56,7 +56,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "By default, the size is just a diameter, resulting in a circle such as the blue circle above. Alternatively, the size can be given as the tuple ``(width, height)`` as shown for the red ellipse above. If you only supply a diameter, you can still specify an ellipse by specifying an optional aspect value and you can also set the orientation (in radians, rotatinf anticlockwise):" + "By default, the size is just a diameter, resulting in a circle such as the blue circle above. Alternatively, the size can be given as the tuple ``(width, height)`` as shown for the red ellipse above. If you only supply a diameter, you can still specify an ellipse by specifying an optional aspect value. In addition, you can also set the orientation (in radians, rotating anticlockwise):" ] }, { diff --git a/examples/elements/matplotlib/Box.ipynb b/examples/elements/matplotlib/Box.ipynb index 05865e5344..8b8c9f13f8 100644 --- a/examples/elements/matplotlib/Box.ipynb +++ b/examples/elements/matplotlib/Box.ipynb @@ -30,7 +30,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "A ``Box`` is an annotation that takes a center x-position, a center y-position and a width:" + "A ``Box`` is an annotation that takes a center x-position, a center y-position and a size:" ] }, { @@ -41,17 +41,19 @@ }, "outputs": [], "source": [ - "%%opts Box (linewidth=5 color='purple') Image (cmap='gray')\n", + "%%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(30, 70), range(30, 70)] = -3\n", - "hv.Image(data) * hv.Box(-0, 0, 0.5 )" + "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) )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "In addition to these arguments, it supports an optional ``aspect ratio``:" + "In addition to these arguments, it supports an optional ``aspect ratio``:\n", + "\n", + "By default, the size argument results in a square such as the small square shown above. Alternatively, the size can be given as the tuple ``(width, height)`` resulting in a rectangle. If you only supply a size value, you can still specify a rectangle by specifying an optional aspect value. In addition, you can also set the orientation (in radians, rotating anticlockwise):" ] }, { @@ -63,7 +65,9 @@ "outputs": [], "source": [ "%%opts Box (linewidth=5 color='purple') Image (cmap='gray')\n", - "hv.Image(data) * hv.Box(-0, 0, 0.25, aspect=3)" + "data = np.sin(np.mgrid[0:100,0:100][1]/10.0)\n", + "data[range(30, 70), range(30, 70)] = -3\n", + "hv.Image(data) * hv.Box(-0, 0, 0.25, aspect=3, orientation=-np.pi/4)" ] } ], diff --git a/examples/elements/matplotlib/Ellipse.ipynb b/examples/elements/matplotlib/Ellipse.ipynb index 0d9df90231..4344e600da 100644 --- a/examples/elements/matplotlib/Ellipse.ipynb +++ b/examples/elements/matplotlib/Ellipse.ipynb @@ -56,7 +56,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "By default, the size is just a diameter, resulting in a circle such as the blue circle above. Alternatively, the size can be given as the tuple ``(width, height)`` as shown for the red ellipse above. If you only supply a diameter, you can still specify an ellipse by specifying an optional aspect value and you can also set the orientation (in radians, rotatinf anticlockwise):" + "By default, the size is just a diameter, resulting in a circle such as the blue circle above. Alternatively, the size can be given as the tuple ``(width, height)`` as shown for the red ellipse above. If you only supply a diameter, you can still specify an ellipse by specifying an optional aspect value. In addition, you can also set the orientation (in radians, rotating anticlockwise):" ] }, {