diff --git a/examples/gallery/demos/matplotlib/nyc_airport_connections.ipynb b/examples/gallery/demos/matplotlib/nyc_airport_connections.ipynb index 8cb2dd811f..03277c0489 100644 --- a/examples/gallery/demos/matplotlib/nyc_airport_connections.ipynb +++ b/examples/gallery/demos/matplotlib/nyc_airport_connections.ipynb @@ -53,8 +53,6 @@ "np.random.seed(14)\n", "graph = layout_nodes(nyc_graph, layout=nx.layout.fruchterman_reingold_layout, kwargs={'weight': 'connections'})\n", "labels = hv.Labels(graph.nodes, ['x', 'y'], ['IATA', 'City'])\n", - "nyc_labels = \n", - "other_labels = " ] }, { diff --git a/examples/gallery/demos/matplotlib/nyc_taxi_connections.ipynb b/examples/gallery/demos/matplotlib/nyc_taxi_connections.ipynb deleted file mode 100644 index 8dba44db9a..0000000000 --- a/examples/gallery/demos/matplotlib/nyc_taxi_connections.ipynb +++ /dev/null @@ -1,108 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Most examples work across multiple plotting backends, this example is also available for:\n", - "\n", - "* [Bokeh NYC Taxi Connection](../bokeh/nyc_taxi_connections.ipynb)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np\n", - "import networkx as nx\n", - "import holoviews as hv\n", - "from holoviews import dim\n", - "\n", - "from holoviews.element.graphs import layout_nodes\n", - "from bokeh.sampledata.airport_routes import routes, airports\n", - "\n", - "hv.extension('matplotlib')\n", - "%output fig='svg' size=300" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Declare data" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Create dataset indexed by AirportID and with additional value dimension\n", - "airports = hv.Dataset(airports, ['AirportID'], ['Name', 'IATA', 'City'])\n", - "source_airports = list(airports.select(City='New York').data.AirportID)\n", - "\n", - "# Add connections count to routes then aggregate and select just routes connecting to NYC\n", - "routes['connections'] = 1\n", - "nyc_graph = hv.Graph((routes, airports), ['SourceID', \"DestinationID\"], ['connections'], label='NYC Airport Connections').aggregate(function=np.count_nonzero).select(SourceID=source_airports)\n", - "\n", - "# Lay out graph weighting and weight by the number of connections\n", - "np.random.seed(14)\n", - "graph = layout_nodes(nyc_graph, layout=nx.layout.fruchterman_reingold_layout, kwargs={'weight': 'connections'})\n", - "labels = hv.Labels(graph.nodes, ['x', 'y'], ['IATA', 'City'])\n", - "nyc_labels = labels.select(City='New York')\n", - "other_labels = labels[labels['City']!='New York']" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Plot" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "cmap={3697: 'red', 3797: 'blue'}\n", - "\n", - "plot = (\n", - " graph.options(\n", - " bgcolor='gray', edge_color=dim('SourceID').categorize(cmap, 'gray'), node_color=dim('index').categorize(cmap, 'gray'),\n", - " xaxis=None, yaxis=None, xlim=(-1.2, 1.2), ylim=(-1.2, 1.2)\n", - " ) *\n", - " nyc_labels.options(color='white', yoffset=0.05, size=16) *\n", - " other_labels.options(color='white', size=8)\n", - ")\n", - "\n", - "plot.relabel('NYC Airport Connections')" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.6" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/reference/elements/matplotlib/HLine.ipynb b/examples/reference/elements/matplotlib/HLine.ipynb index ef7b40b2f1..8eba1348ad 100644 --- a/examples/reference/elements/matplotlib/HLine.ipynb +++ b/examples/reference/elements/matplotlib/HLine.ipynb @@ -44,8 +44,8 @@ "points = hv.Points((xs,ys))\n", "\n", "(points * hv.HLine(ys.mean())).opts(\n", - " opts.HLine(color='#D3D3D3')\n", - " opts.Points(color='blue', linewidth=6))" + " opts.HLine(color='blue', linewidth=6),\n", + " opts.Points(color='#D3D3D3'))" ] }, { diff --git a/examples/reference/elements/matplotlib/Spline.ipynb b/examples/reference/elements/matplotlib/Spline.ipynb index 14e5d003da..ebe6aac911 100644 --- a/examples/reference/elements/matplotlib/Spline.ipynb +++ b/examples/reference/elements/matplotlib/Spline.ipynb @@ -42,7 +42,7 @@ "spline = hv.Spline((points, [1,4,4,4]))\n", "\n", "(spline * hv.Curve(points)).opts(\n", - " opts.Curve(color='#D3D3D3')\n", + " opts.Curve(color='#D3D3D3'),\n", " opts.Spline(linewidth=6, edgecolor='green'))" ] }, diff --git a/examples/reference/elements/matplotlib/VLine.ipynb b/examples/reference/elements/matplotlib/VLine.ipynb index a464e1e07c..bfd357da8c 100644 --- a/examples/reference/elements/matplotlib/VLine.ipynb +++ b/examples/reference/elements/matplotlib/VLine.ipynb @@ -45,7 +45,7 @@ "\n", "(hv.Curve((xs,ys)) * vline).opts(\n", " opts.Curve(color='#D3D3D3'),\n", - " opts.Vline(color='red', linewidth=6)" + " opts.VLine(color='red', linewidth=6))" ] }, { diff --git a/holoviews/plotting/plotly/renderer.py b/holoviews/plotting/plotly/renderer.py index e98f80aad5..52f9964e5b 100644 --- a/holoviews/plotting/plotly/renderer.py +++ b/holoviews/plotting/plotly/renderer.py @@ -56,7 +56,7 @@ def __call__(self, obj, fmt='html', divuuid=None): if isinstance(plot, tuple(self.widgets.values())): return plot(), mime_types elif fmt in ('html', 'png', 'svg'): - return self._figure_data(plot, divuuid=divuuid), mime_types + return self._figure_data(plot, fmt, divuuid=divuuid), mime_types elif fmt == 'json': return self.diff(plot), mime_types