Skip to content

Large markers escape legend #8705

Closed as not planned
Closed as not planned
@amueller

Description

@amueller

Bug report

Bug summary

Increasing marker size leads to markers that escape the legend boundaries (or even the figure)

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt

a, = plt.plot(np.random.uniform(size=10), np.random.uniform(size=10), '*',  markersize=40)

b, = plt.plot(np.random.uniform(size=10), np.random.uniform(size=10), '*',  markersize=40)
plt.legend([a, b],
           ["training data/target", "test data", "test prediction"],
           ncol=3, loc=(.1, 1.025))

Actual outcome

image

Expected outcome

Legend box grows to capture whole marker.

Matplotlib version

  • Operating System: Ubuntu 17.04
  • Matplotlib Version: 2.0.1 (conda default channel)
  • Python Version: 3.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions