10000 ha="right" breaks AnchoredText placement. · Issue #18363 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
ha="right" breaks AnchoredText placement. #18363
Closed
@janosh

Description

@janosh

Bug report

Bug summary

Setting ha="right" through the prop kwarg breaks AnchoredText placement.

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredText

prop = {"ha": "right", "bbox": {"lw": 0.5, "facecolor": "white"}}
text_box = AnchoredText("test\ntest long text for ha", prop=prop, loc="upper right", pad=0.2)
plt.gca().add_artist(text_box)

Actual outcome

bug

Expected outcome

I was expecting the text box to end up in the same place it does when not setting ha="right":

normal

Matplotlib version

  • Operating system: macOS 10.15.6
  • Matplotlib version: 3.2.1 (pip-installed)
  • Matplotlib backend: module://ipykernel.pylab.backend_inline
  • Python version: 3.6.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0