hi,
i am trying to create a line stacked subplotsā¦ some thing like below
multiple of these types of graphs as a subplot.
below is my code:
import plotly.offline as pyo
import plotly.graph_objs as go
import pandas as pd
from plotly.tools import make_subplotsNE = pd.read_csv(āC:\py\programs\plotly\final\NE.csvā)
week_days = NE[ādateā].unique()
data1 =
data2 =for day in week_days:
trace_volte_traffic = dict(type=āscatterā, x=NE[ātimeā], y=NE[NE[ādateā] == day]
[āL.Traffic.User.VoIP.Avgā], mode=ālines+markersā, name=āvolte_trafficā)
data1.append(trace_volte_traffic)for day in week_days:
trace_PS_Traffic = dict(type=āscatterā, x=NE[ātimeā], y=NE[NE[ādateā] == day]
[āLTE Traffic (DL+UL) - GBā], mode=ālines+markersā, name=āPS_trafficā)
data2.append(trace_PS_Traffic)fig = make_subplots(rows=2, cols=2,
horizontal_spacing=0.1,
vertical_spacing=0.1,
subplot_titles=[āVolte Trafficā, āPS Trafficā], shared_yaxes=True)fig.append_trace(data1, 1, 1)
fig.append_trace(data2, 1, 2)fig[ālayoutā].update(height=1000, width=1600, title=āCS Trafficā)
pyo.plot(fig)
but i am getting below error
The ādataā property is a tuple of trace instances
that may be specified as:
- A list or tuple of trace instances
(e.g. [Scatter(ā¦), Bar(ā¦)])
- A list or tuple of dicts of string/value properties where:
- The ātypeā property specifies the trace type
One of: [āareaā, ābarā, ābarpolarā, āboxā,
ācandlestickā, ācarpetā, āchoroplethā, āconeā,
ācontourā, ācontourcarpetā, āheatmapā,
āheatmapglā, āhistogramā, āhistogram2dā,
āhistogram2dcontourā, āmesh3dā, āohlcā,
āparcoordsā, āpieā, āpointcloudā, āsankeyā,
āscatterā, āscatter3dā, āscattercarpetā,
āscattergeoā, āscatterglā, āscattermapboxā,
āscatterpolarā, āscatterpolarglā,
āscatterternaryā, āsplomā, āstreamtubeā,
āsurfaceā, ātableā, āviolinā]- All remaining properties are passed to the constructor of the specified trace type (e.g. [{'type': 'scatter', ...}, {'type': 'bar, ...}])
i am new to programming, so really thankful for your patience .
Best Regards