Plotly Tutorial
Selected Reading
- Plotly - Discussion
- Plotly - Useful Resources
- Plotly - Quick Guide
- Plotly with Matplotlib and Chart Studio
- Plotly with Pandas and Cufflinks
- Plotly - FigureWidget Class
- Plotly - Slider Control
- Plotly - Adding Buttons/Dropdown
- Plotly - 3D Scatter & Surface Plot
- Plotly - OHLC Chart Waterfall Chart & Funnel Chart
- Plotly - Polar Chart & Radar Chart
- Plotly - Heatmap
- Plotly - Distplots, Density Plot & Error Bar Plot
- Plotly - Box Plot Violin Plot & Contour Plot
- Plotly - Histogram
- Plotly - Dot Plots & Table
- Plotly - Scatter Plot, Scattergl Plot & Bubble Charts
- Plotly - Bar Chart & Pie Chart
- Plotly - Subplots & Inset Plots
- Plotly - Format Axis & Ticks
- Plotly - Legends
- Plotly - Exporting to Static Images
- Plotly - Package Structure
- Plotting Inline with Jupyter Notebook
- Plotly - Online & Offline Plotting
- Plotly - Environment Setup
- Plotly - Introduction
- Plotly - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Plotting Inline with Jupyter Notebook
Plotly - Plotting Inpne with Jupyter Notebook
In this chapter, we will study how to do inpne plotting with the Jupyter Notebook.
In order to display the plot inside the notebook, you need to initiate plotly’s notebook mode as follows −
from plotly.offpne import init_notebook_mode init_notebook_mode(connected = True)
Keep rest of the script as it is and run the notebook cell by pressing Shift+Enter. Graph will be displayed offpne inside the notebook itself.
import plotly plotly.tools.set_credentials_file(username = lathkar , api_key = ************ ) from plotly.offpne import iplot, init_notebook_mode init_notebook_mode(connected = True) import plotly import plotly.graph_objs as go import numpy as np import math #needed for definition of pi xpoints = np.arange(0, math.pi*2, 0.05) ypoints = np.sin(xpoints) trace0 = go.Scatter( x = xpoints, y = ypoints ) data = [trace0] plotly.offpne.iplot({ "data": data,"layout": go.Layout(title="Sine wave")})
Jupyter notebook output will be as shown below −
The plot output shows a tool bar at top right. It contains buttons for download as png, zoom in and out, box and lasso, select and hover.
Advertisements