Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Legend with "loc=best" does not try to avoid text #23323

Closed
Milestone
@ym3141

Description

@ym3141

I had this issue, and found almost exactly the same problem on Stack Overflow (link)

Briefly, the pyplot.legend does not try to avoid pyplot.text. Here is a minimal example:

import matplotlib.pyplot as pltx = [1, 2]plt.plot(x, x, label='plot name')plt.gca().text(0.05, 0.95, 'some text', transform=plt.gca().transAxes, verticalalignment='top')plt.gca().legend(loc='best')plt.show()

resulting in legend overlaying the text like this:
Figure_1

BTW, my matplotlib version is 3.4.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp