I\'d like to be able to add a title to the legend, in the following code. However, looking at the docs, I don\'t think there is a method for this.
import plo
I've done this before by making a data-less trace
import plotly.plotly as py
import plotly.graph_objs as go
dummy_trace = go.Scatter(
x=[None], y=[None],
name='Legend Heading',
# set opacity = 0
line={'color': 'rgba(0, 0, 0, 0)'}
)
trace0 = go.Scatter(
x=[1, 2, 3, 4, 5],
y=[1, 2, 3, 4, 5],
)
trace1 = go.Scatter(
x=[1, 2, 3, 4, 5],
y=[5, 4, 3, 2, 1],
)
data = [dummy_trace, trace0, trace1]
fig = go.Figure(data=data)
py.iplot(fig)