{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#### New to Plotly?\n", "Plotly's Python library is free and open source! [Get started](https://plotly.com/python/getting-started/) by downloading the client and [reading the primer](https://plotly.com/python/getting-started/).\n", "
You can set up Plotly to work in [online](https://plotly.com/python/getting-started/#initialization-for-online-plotting) or [offline](https://plotly.com/python/getting-started/#initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plotly.com/python/getting-started/#start-plotting-online).\n", "
We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Simple Subplot" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ] [ (1,2) x2,y2 ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(\n", " x=[1, 2, 3],\n", " y=[4, 5, 6],\n", " mode='markers+text',\n", " text=['Text A', 'Text B', 'Text C'],\n", " textposition='bottom center'\n", ")\n", "trace2 = go.Scatter(\n", " x=[20, 30, 40],\n", " y=[50, 60, 70],\n", " mode='markers+text',\n", " text=['Text D', 'Text E', 'Text F'],\n", " textposition='bottom center'\n", ")\n", "\n", "fig = tools.make_subplots(rows=1, cols=2)\n", "\n", "fig.append_trace(trace1, 1, 1)\n", "fig.append_trace(trace2, 1, 2)\n", "\n", "fig['layout'].update(height=600, width=800, title='i <3 annotations and subplots')\n", "py.iplot(fig, filename='simple-subplot-with-annotations')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Multiple Subplots" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(\n", " x=[1, 2, 3],\n", " y=[4, 5, 6]\n", ")\n", "trace2 = go.Scatter(\n", " x=[20, 30, 40],\n", " y=[50, 60, 70],\n", " xaxis='x2',\n", " yaxis='y2'\n", ")\n", "trace3 = go.Scatter(\n", " x=[300, 400, 500],\n", " y=[600, 700, 800],\n", " xaxis='x3',\n", " yaxis='y3'\n", ")\n", "trace4 = go.Scatter(\n", " x=[4000, 5000, 6000],\n", " y=[7000, 8000, 9000],\n", " xaxis='x4',\n", " yaxis='y4'\n", ")\n", "data = [trace1, trace2, trace3, trace4]\n", "layout = go.Layout(\n", " xaxis=dict(\n", " domain=[0, 0.45]\n", " ),\n", " yaxis=dict(\n", " domain=[0, 0.45]\n", " ),\n", " xaxis2=dict(\n", " domain=[0.55, 1]\n", " ),\n", " xaxis3=dict(\n", " domain=[0, 0.45],\n", " anchor='y3'\n", " ),\n", " xaxis4=dict(\n", " domain=[0.55, 1],\n", " anchor='y4'\n", " ),\n", " yaxis2=dict(\n", " domain=[0, 0.45],\n", " anchor='x2'\n", " ),\n", " yaxis3=dict(\n", " domain=[0.55, 1]\n", " ),\n", " yaxis4=dict(\n", " domain=[0.55, 1],\n", " anchor='x4'\n", " )\n", ")\n", "fig = go.Figure(data=data, layout=layout)\n", "py.iplot(fig, filename='multiple-subplots')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Multiple Subplots with Titles" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ] [ (1,2) x2,y2 ]\n", "[ (2,1) x3,y3 ] [ (2,2) x4,y4 ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(x=[1, 2, 3], y=[4, 5, 6])\n", "trace2 = go.Scatter(x=[20, 30, 40], y=[50, 60, 70])\n", "trace3 = go.Scatter(x=[300, 400, 500], y=[600, 700, 800])\n", "trace4 = go.Scatter(x=[4000, 5000, 6000], y=[7000, 8000, 9000])\n", "\n", "fig = tools.make_subplots(rows=2, cols=2, subplot_titles=('Plot 1', 'Plot 2',\n", " 'Plot 3', 'Plot 4'))\n", "\n", "fig.append_trace(trace1, 1, 1)\n", "fig.append_trace(trace2, 1, 2)\n", "fig.append_trace(trace3, 2, 1)\n", "fig.append_trace(trace4, 2, 2)\n", "\n", "fig['layout'].update(height=600, width=600, title='Multiple Subplots' +\n", " ' with Titles')\n", "\n", "py.iplot(fig, filename='make-subplots-multiple-with-titles')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Simple Subplot with Annotations" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ] [ (1,2) x2,y2 ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(\n", " x=[1, 2, 3],\n", " y=[4, 5, 6],\n", " mode='markers+text',\n", " text=['Text A', 'Text B', 'Text C'],\n", " textposition='bottom center'\n", ")\n", "trace2 = go.Scatter(\n", " x=[20, 30, 40],\n", " y=[50, 60, 70],\n", " mode='markers+text',\n", " text=['Text D', 'Text E', 'Text F'],\n", " textposition='bottom center'\n", ")\n", "\n", "fig = tools.make_subplots(rows=1, cols=2)\n", "\n", "fig.append_trace(trace1, 1, 1)\n", "fig.append_trace(trace2, 1, 2)\n", "\n", "fig['layout'].update(height=600, width=800, title='i <3 annotations and subplots')\n", "py.iplot(fig, filename='simple-subplot-with-annotations')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Side by Side Subplot" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(\n", " x=[1, 2, 3],\n", " y=[4, 5, 6]\n", ")\n", "trace2 = go.Scatter(\n", " x=[20, 30, 40],\n", " y=[50, 60, 70],\n", " xaxis='x2',\n", " yaxis='y2'\n", ")\n", "data = [trace1, trace2]\n", "layout = go.Layout(\n", " xaxis=dict(\n", " domain=[0, 0.7]\n", " ),\n", " xaxis2=dict(\n", " domain=[0.8, 1]\n", " ),\n", " yaxis2=dict(\n", " anchor='x2'\n", " )\n", ")\n", "fig = go.Figure(data=data, layout=layout)\n", "py.iplot(fig, filename='side-by-side-subplot')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Customizing Subplot Axes" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ] [ (1,2) x2,y2 ]\n", "[ (2,1) x3,y3 ] [ (2,2) x4,y4 ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(x=[1, 2, 3], y=[4, 5, 6])\n", "trace2 = go.Scatter(x=[20, 30, 40], y=[50, 60, 70])\n", "trace3 = go.Scatter(x=[300, 400, 500], y=[600, 700, 800])\n", "trace4 = go.Scatter(x=[4000, 5000, 6000], y=[7000, 8000, 9000])\n", "\n", "fig = tools.make_subplots(rows=2, cols=2, subplot_titles=('Plot 1', 'Plot 2',\n", " 'Plot 3', 'Plot 4'))\n", "fig.append_trace(trace1, 1, 1)\n", "fig.append_trace(trace2, 1, 2)\n", "fig.append_trace(trace3, 2, 1)\n", "fig.append_trace(trace4, 2, 2)\n", "\n", "fig['layout']['xaxis1'].update(title='xaxis 1 title')\n", "fig['layout']['xaxis2'].update(title='xaxis 2 title', range=[10, 50])\n", "fig['layout']['xaxis3'].update(title='xaxis 3 title', showgrid=False)\n", "fig['layout']['xaxis4'].update(title='xaxis 4 title', type='log')\n", "\n", "fig['layout']['yaxis1'].update(title='yaxis 1 title')\n", "fig['layout']['yaxis2'].update(title='yaxis 2 title', range=[40, 80])\n", "fig['layout']['yaxis3'].update(title='yaxis 3 title', showgrid=False)\n", "fig['layout']['yaxis4'].update(title='yaxis 4 title')\n", "\n", "fig['layout'].update(title='Customizing Subplot Axes')\n", "\n", "py.iplot(fig, filename='customizing-subplot-axes')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Subplots with Shared X-Axes" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ]\n", "[ (2,1) x1,y2 ]\n", "[ (3,1) x1,y3 ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(\n", " x=[0, 1, 2],\n", " y=[10, 11, 12]\n", ")\n", "trace2 = go.Scatter(\n", " x=[2, 3, 4],\n", " y=[100, 110, 120],\n", ")\n", "trace3 = go.Scatter(\n", " x=[3, 4, 5],\n", " y=[1000, 1100, 1200],\n", ")\n", "fig = tools.make_subplots(rows=3, cols=1, specs=[[{}], [{}], [{}]],\n", " shared_xaxes=True, shared_yaxes=True,\n", " vertical_spacing=0.001)\n", "fig.append_trace(trace1, 3, 1)\n", "fig.append_trace(trace2, 2, 1)\n", "fig.append_trace(trace3, 1, 1)\n", "\n", "fig['layout'].update(height=600, width=600, title='Stacked Subplots with Shared X-Axes')\n", "py.iplot(fig, filename='stacked-subplots-shared-xaxes')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Subplots with Shared Y-Axes" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ] [ (1,2) x2,y1 ]\n", "[ (2,1) x3,y2 ] [ (2,2) x4,y2 ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace0 = go.Scatter(\n", " x=[1, 2, 3],\n", " y=[2, 3, 4]\n", ")\n", "trace1 = go.Scatter(\n", " x=[20, 30, 40],\n", " y=[5, 5, 5],\n", ")\n", "trace2 = go.Scatter(\n", " x=[2, 3, 4],\n", " y=[600, 700, 800],\n", ")\n", "trace3 = go.Scatter(\n", " x=[4000, 5000, 6000],\n", " y=[7000, 8000, 9000],\n", ")\n", "\n", "fig = tools.make_subplots(rows=2, cols=2, shared_yaxes=True)\n", "\n", "fig.append_trace(trace0, 1, 1)\n", "fig.append_trace(trace1, 1, 2)\n", "fig.append_trace(trace2, 2, 1)\n", "fig.append_trace(trace3, 2, 2)\n", "\n", "fig['layout'].update(height=600, width=600,\n", " title='Multiple Subplots with Shared Y-Axes')\n", "py.iplot(fig, filename='multiple-subplots-shared-yaxes')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Subplots with Shared Axes" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(\n", " x=[1, 2, 3],\n", " y=[2, 3, 4]\n", ")\n", "trace2 = go.Scatter(\n", " x=[20, 30, 40],\n", " y=[5, 5, 5],\n", " xaxis='x2',\n", " yaxis='y'\n", ")\n", "trace3 = go.Scatter(\n", " x=[2, 3, 4],\n", " y=[600, 700, 800],\n", " xaxis='x',\n", " yaxis='y3'\n", ")\n", "trace4 = go.Scatter(\n", " x=[4000, 5000, 6000],\n", " y=[7000, 8000, 9000],\n", " xaxis='x4',\n", " yaxis='y4'\n", ")\n", "data = [trace1, trace2, trace3, trace4]\n", "layout = go.Layout(\n", " xaxis=dict(\n", " domain=[0, 0.45]\n", " ),\n", " yaxis=dict(\n", " domain=[0, 0.45]\n", " ),\n", " xaxis2=dict(\n", " domain=[0.55, 1]\n", " ),\n", " xaxis4=dict(\n", " domain=[0.55, 1],\n", " anchor='y4'\n", " ),\n", " yaxis3=dict(\n", " domain=[0.55, 1]\n", " ),\n", " yaxis4=dict(\n", " domain=[0.55, 1],\n", " anchor='x4'\n", " )\n", ")\n", "fig = go.Figure(data=data, layout=layout)\n", "py.iplot(fig, filename='shared-axes-subplots')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Stacked Subplots" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ]\n", "[ (2,1) x2,y2 ]\n", "[ (3,1) x3,y3 ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(\n", " x=[0, 1, 2],\n", " y=[10, 11, 12]\n", ")\n", "trace2 = go.Scatter(\n", " x=[2, 3, 4],\n", " y=[100, 110, 120],\n", ")\n", "trace3 = go.Scatter(\n", " x=[3, 4, 5],\n", " y=[1000, 1100, 1200],\n", ")\n", "\n", "fig = tools.make_subplots(rows=3, cols=1)\n", "\n", "fig.append_trace(trace3, 1, 1)\n", "fig.append_trace(trace2, 2, 1)\n", "fig.append_trace(trace1, 3, 1)\n", "\n", "\n", "fig['layout'].update(height=600, width=600, title='Stacked subplots')\n", "py.iplot(fig, filename='stacked-subplots')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Stacked Subplots with a Shared X-Axis" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(\n", " x=[0, 1, 2],\n", " y=[10, 11, 12]\n", ")\n", "trace2 = go.Scatter(\n", " x=[2, 3, 4],\n", " y=[100, 110, 120],\n", " yaxis='y2'\n", ")\n", "trace3 = go.Scatter(\n", " x=[3, 4, 5],\n", " y=[1000, 1100, 1200],\n", " yaxis='y3'\n", ")\n", "data = [trace1, trace2, trace3]\n", "layout = go.Layout(\n", " yaxis=dict(\n", " domain=[0, 0.33]\n", " ),\n", " legend=dict(\n", " traceorder='reversed'\n", " ),\n", " yaxis2=dict(\n", " domain=[0.33, 0.66]\n", " ),\n", " yaxis3=dict(\n", " domain=[0.66, 1]\n", " )\n", ")\n", "fig = go.Figure(data=data, layout=layout)\n", "py.iplot(fig, filename='stacked-subplots-shared-x-axis')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Custom Sized Subplot with Subplot Titles" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ] [ (1,2) x2,y2 ]\n", "[ (2,1) x3,y3 - ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace0 = go.Scatter(\n", " x=[1, 2],\n", " y=[1, 2]\n", ")\n", "trace1 = go.Scatter(\n", " x=[1, 2],\n", " y=[1, 2]\n", ")\n", "trace2 = go.Scatter(\n", " x=[1, 2, 3],\n", " y=[2, 1, 2]\n", ")\n", "fig = tools.make_subplots(rows=2, cols=2, specs=[[{}, {}], [{'colspan': 2}, None]],\n", " subplot_titles=('First Subplot','Second Subplot', 'Third Subplot'))\n", "\n", "fig.append_trace(trace0, 1, 1)\n", "fig.append_trace(trace1, 1, 2)\n", "fig.append_trace(trace2, 2, 1)\n", "\n", "fig['layout'].update(showlegend=False, title='Specs with Subplot Title')\n", "py.iplot(fig, filename='custom-sized-subplot-with-subplot-titles')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Multiple Custom Sized Subplots" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is the format of your plot grid:\n", "[ (1,1) x1,y1 ] [ (1,2) x2,y2 ]\n", "[ (2,1) x3,y3 ] | \n", "[ (3,1) x4,y4 - ]\n", " | | \n", "[ (5,1) x5,y5 ] [ (5,2) x6,y6 ]\n", "\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from plotly import tools\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "trace1 = go.Scatter(x=[1, 2], y=[1, 2], name='(1,1)')\n", "trace2 = go.Scatter(x=[1, 2], y=[1, 2], name='(1,2)')\n", "trace3 = go.Scatter(x=[1, 2], y=[1, 2], name='(2,1)')\n", "trace4 = go.Scatter(x=[1, 2], y=[1, 2], name='(3,1)')\n", "trace5 = go.Scatter(x=[1, 2], y=[1, 2], name='(5,1)')\n", "trace6 = go.Scatter(x=[1, 2], y=[1, 2], name='(5,2)')\n", "\n", "fig = tools.make_subplots(rows=5, cols=2,\n", " specs=[[{}, {'rowspan': 2}],\n", " [{}, None],\n", " [{'rowspan': 2, 'colspan': 2}, None],\n", " [None, None],\n", " [{}, {}]],\n", " print_grid=True)\n", "\n", "fig.append_trace(trace1, 1, 1)\n", "fig.append_trace(trace2, 1, 2)\n", "fig.append_trace(trace3, 2, 1)\n", "fig.append_trace(trace4, 3, 1)\n", "fig.append_trace(trace5, 5, 1)\n", "fig.append_trace(trace6, 5, 2)\n", "\n", "fig['layout'].update(height=600, width=600, title='specs examples')\n", "py.iplot(fig, filename='multiple-custom-sized-subplots')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Dash Example" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[Dash](https://plotly.com/products/dash/) is an Open Source Python library which can help you convert plotly figures into a reactive, web-based application. Below is a simple example of a dashboard created using Dash. Its [source code](https://github.com/plotly/simple-example-chart-apps/tree/master/dash-multiplesubplot) can easily be deployed to a PaaS." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import IFrame\n", "IFrame(src= \"https://dash-simple-apps.plotly.host/dash-multiplesubplot/\", width=\"100%\", height=\"950px\", frameBorder=\"0\")" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import IFrame\n", "IFrame(src= \"https://dash-simple-apps.plotly.host/dash-multiplesubplot/code\", width=\"100%\", height=500, frameBorder=\"0\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Reference\n", "All of the x-axis properties are found here: https://plotly.com/python/reference/#XAxis\n", "All of the y-axis properties are found here: https://plotly.com/python/reference/#YAxis" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Collecting git+https://github.com/plotly/publisher.git\n", " Cloning https://github.com/plotly/publisher.git to /private/var/folders/s5/vjqn03zs7nn8zs_fwzcf14r40000gn/T/pip-req-build-8j6l2c67\n", "Building wheels for collected packages: publisher\n", " Building wheel for publisher (setup.py) ... \u001b[?25ldone\n", "\u001b[?25h Stored in directory: /private/var/folders/s5/vjqn03zs7nn8zs_fwzcf14r40000gn/T/pip-ephem-wheel-cache-2sqykrw1/wheels/99/3e/a0/fbd22ba24cca72bdbaba53dbc23c1768755fb17b3af0f33966\n", "Successfully built publisher\n", "Installing collected packages: publisher\n", " Found existing installation: publisher 0.13\n", " Uninstalling publisher-0.13:\n", " Successfully uninstalled publisher-0.13\n", "Successfully installed publisher-0.13\n", "\u001b[33mYou are using pip version 19.0.3, however version 19.1.1 is available.\n", "You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n" ] } ], "source": [ "from IPython.display import display, HTML\n", "\n", "display(HTML(''))\n", "display(HTML(''))\n", "\n", "! pip install git+https://github.com/plotly/publisher.git --upgrade\n", "import publisher\n", "publisher.publish(\n", " 'subplots.ipynb', 'python/subplots/', 'Subplots | plotly',\n", " 'How to make subplots in python. Examples of stacked, custom-sized, gridded, and annotated subplts.',\n", " title = 'Python Subplots | Examples | Plotly',\n", " name = 'Subplots', has_thumbnail='true', thumbnail='thumbnail/subplots.jpg', \n", " language='python', page_type='example_index', redirect_from='ipython-notebooks/subplots/', \n", " display_as='file_settings', order=15,\n", " ipynb='~notebook_demo/269')" ] } ], "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.5" } }, "nbformat": 4, "nbformat_minor": 2 }