Skip to content

[MPL conversion] Offline plot does not show legend correctly #910

Closed
@onewhaleid

Description

@onewhaleid

Using plotly.offline.plot_mpl, I am not able to create an interactive legend. In fact, the legend entries simply appear as text, without the matching line or symbol key.

plotly 2.2.2
matplotlib 2.1.0

Here is my code:

import matplotlib.pyplot as plt
import plotly.offline

fig, ax = plt.subplots()

ax.plot([0, 1, 2], [0, 1, 2], 'o-', label='a')
ax.plot([0, 1, 2], [0.5, 1.5, 2.5], 'o-', label='b')

ax.legend()

plotly.offline.plot_mpl(fig, filename='temp-plot.html')

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions