Skip to content

Feature request: allow a single label for a group of lines #423

Open
@kinyatoride

Description

@kinyatoride

Description

Hi, is it possible to allow a single label for a group of lines? Currently, we need to pass the same number of labels for plotted elements.
Here, I am showing an example of the wished behavior.

import numpy as np
import proplot as pplt

state = np.random.RandomState(51423)
x = np.linspace(0, 5, 20)
y1 = x[:, np.newaxis] + state.rand(20, 10)
y2 = x[::-1, np.newaxis] + state.rand(20, 10)

fig, ax = pplt.subplots()
ax.plot(y1, c='r', label='y1')
ax.plot(y2, c='b', label='y2')
ax.legend()

Expected behavior
output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions