-
-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vectorized VLines, HLines, VSpans and HSpans elements (#5845)
Co-authored-by: Simon Høxbro Hansen <[email protected]> Co-authored-by: Philipp Rudiger <[email protected]>
- Loading branch information
1 parent
0dad517
commit 06d2b6d
Showing
16 changed files
with
1,311 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"#### **Title**: HLine Element\n", | ||
"\n", | ||
"**Dependencies**: Bokeh 3.2\n", | ||
"\n", | ||
"**Backends**: [Matplotlib](../matplotlib/HLines.ipynb), [Bokeh](../bokeh/HLines.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import holoviews as hv\n", | ||
"\n", | ||
"hv.extension('bokeh')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The ``HLines`` element is a type of annotation that can mark multiple lines along the y-axis. It accepts a list of y-coordinates and will draw a horizontal line at each location. This has the advantage over [``HLine``](./HLine.ipynb) of being able to draw multiple lines at once and also being able to get hover information for each of the line." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ys = np.random.normal(size=10)\n", | ||
"hv.HLines(ys).opts(tools=['hover'], color='red', line_width=5)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"For full documentation and the available style and plot options, use ``hv.help(hv.HLines).``" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"#### **Title**: HLine Element\n", | ||
"\n", | ||
"**Dependencies**: Bokeh 3.2\n", | ||
"\n", | ||
"**Backends**: [Matplotlib](../matplotlib/HSpans.ipynb), [Bokeh](../bokeh/HSpans.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import holoviews as hv\n", | ||
"\n", | ||
"hv.extension('bokeh')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The ``HSpans`` element is a type of annotation that can mark multiple spans along the y-axis. It accepts a list of start and end y-coordinates and will draw horizontal spans. This has the advantage over [``HSpan``](./HSpan.ipynb) of being able to draw multiple spans at once and also being able to get hover information for each of the span." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"y_start = np.arange(10)\n", | ||
"y_end = y_start + np.random.random(size=10) / 2\n", | ||
"hv.HSpans((y_start, y_end)).opts(tools=['hover'], color='red')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"For full documentation and the available style and plot options, use ``hv.help(hv.HSpans).``" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"#### **Title**: HLine Element\n", | ||
"\n", | ||
"**Dependencies**: Bokeh 3.2\n", | ||
"\n", | ||
"**Backends**: [Matplotlib](../matplotlib/VLines.ipynb), [Bokeh](../bokeh/VLines.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import holoviews as hv\n", | ||
"\n", | ||
"hv.extension('bokeh')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The ``VLines`` element is a type of annotation that can mark multiple lines along the x-axis. It accepts a list of x-coordinates and will draw a vertical line at each location. This has the advantage over [``VLine``](./VLine.ipynb) of being able to draw multiple lines at once and also being able to get hover information for each of the line." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"xs = np.random.normal(size=10)\n", | ||
"hv.VLines(xs).opts(tools=['hover'], color='red', line_width=5)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"For full documentation and the available style and plot options, use ``hv.help(hv.VLines).``" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"#### **Title**: HLine Element\n", | ||
"\n", | ||
"**Dependencies**: Bokeh 3.2\n", | ||
"\n", | ||
"**Backends**: [Matplotlib](../matplotlib/VSpans.ipynb), [Bokeh](../bokeh/VSpans.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import holoviews as hv\n", | ||
"\n", | ||
"hv.extension('bokeh')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The ``VSpans`` element is a type of annotation that can mark multiple spans along the x-axis. It accepts a list of start and end x-coordinates and will draw vertical spans at each location. This has the advantage over [``VSpan``](./VSpan.ipynb) of being able to draw multiple spans at once and also being able to get hover information for each of the span." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"x_start = np.arange(10)\n", | ||
"x_end = x_start + np.random.random(size=10) / 2\n", | ||
"hv.VSpans((x_start, x_end)).opts(tools=['hover'], color='red')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"For full documentation and the available style and plot options, use ``hv.help(hv.VSpans).``" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"#### **Title**: HLine Element\n", | ||
"\n", | ||
"**Dependencies**: Matplotlib\n", | ||
"\n", | ||
"**Backends**: [Matplotlib](../matplotlib/HLines.ipynb), [Bokeh](../bokeh/HLines.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import holoviews as hv\n", | ||
"\n", | ||
"hv.extension('matplotlib')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The ``HLines`` element is a type of annotation that can mark multiple lines along the y-axis. It accepts a list of y-coordinates and will draw a horizontal line at each location. This has the advantage over [``HLine``](./HLine.ipynb) of being able to draw multiple lines at once." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ys = np.random.normal(size=10)\n", | ||
"hv.HLines(ys).opts(color='red')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"For full documentation and the available style and plot options, use ``hv.help(hv.HLines).``" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"#### **Title**: HLine Element\n", | ||
"\n", | ||
"**Dependencies**: Matplotlib\n", | ||
"\n", | ||
"**Backends**: [Matplotlib](../matplotlib/HSpans.ipynb), [Bokeh](../bokeh/HSpans.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np\n", | ||
"import holoviews as hv\n", | ||
"\n", | ||
"hv.extension('matplotlib')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The ``HSpans`` element is a type of annotation that can mark multiple spans along the y-axis. It accepts a list of start and end y-coordinates and will draw horizontal spans. This has the advantage over [``HSpan``](./HSpan.ipynb) of being able to draw multiple spans at once." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"y_start = np.arange(10)\n", | ||
"y_end = y_start + np.random.random(size=10) / 2\n", | ||
"hv.HSpans((y_start, y_end)).opts(color='red')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"For full documentation and the available style and plot options, use ``hv.help(hv.HSpans).``" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
Oops, something went wrong.