I have been trying to plot a table and a scatter plot side by side using plotly but to no avail for a long period. How can we do that?
How to plot table and scatter plots in plotly3.6?
I have tried this so far:
import numpy as np
import pandas as pd
import seaborn as sns
sns.set(color_codes=True)
import matplotlib.pyplot as plt
%matplotlib inline
import plotly
import plotly.offline as py
import plotly.plotly as pyp
import plotly.graph_objs as go
import plotly.figure_factory as ff
import plotly.tools as tls
from plotly.offline import plot, iplot, init_notebook_mode
init_notebook_mode(connected=False)
# subplots table
fig = tls.make_subplots(rows=1, cols=2, shared_xaxes=True)
trace1 = go.Scatter(x=[1,2,3],y=[1,2,3])
df = pd.DataFrame({'name':list('ABC'),
'salary': [1000,2000,3000]})
table = ff.create_table(df)
fig.append_trace(table, 1, 2)
py.iplot(fig)
But this does not work.
However,
iplot(table) works.
How to fix the problem?