Plotly:
Plotly is an organization that makes visualization tools including a Python API library. Plotly Python library can be used to create interactive graphs in an easier, faster and efficient way. Plotly library is a declarative programming and best alternative to matplotlib. Let us see more about its role in data visualization in this article.
Features:
- It can be installed as an on-premises API.
- It can be used to style interactive graphs with IPython.
- Used to convert matplotlib graphs into interactive ones.
- Chart can be edited by the online editor which automatically generate the Python code behind.
Example:
Consider a call center dataset, following plotly code, demonstrates the relationship between time and inbound calls in interactive line graphs.
Code:
import plotly
import pandas as pd
import plotly.graph_objs as go
df=pd.read_csv('Call_Center_Metrics_for_the_Health_Service_System.csv')
df1 = go.Scatter(x=df['Month'], y=df['Inbound Calls'])
layout = go.Layout(title='Monthwise Inbound Calls',
xaxis=dict(title='Months'),
yaxis=dict(title='Count of Inbound Calls'))
fig = go.Figure(data=[df1], layout=layout)
plotly.offline.plot(fig)
Drawbacks:
- Requires code knowledge in plotly to create a basic plot.
- Need more effect to adjust the appearance of the graphs.