Skip to content

[Bug]: ax.text() Is Not Rendered If X Specified With ax.plot() #25127

Closed as not planned
@Matthew1471

Description

@Matthew1471

Bug summary

ax.text() is not rendered if x values are supplied to ax.plot()

Code for reproduction

# Straight from the example : https://matplotlib.org/stable/users/explain/api_interfaces.html#api-interfaces

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.subplots()

# Text works!
#ax.plot([0, 0.5, 1, 0.2])

# Text no works!
ax.plot([1, 2, 3, 4], [0, 0.5, 1, 0.2])

# Text drawing.
ax.text(0, 0, 'Hello!')

plt.show()

Actual outcome

Text is not displayed.

Expected outcome

Text is displayed.

Additional information

I narrowed it down to plot with x values means text is not displayed.

Operating system

Windows

Matplotlib Version

3.6.3

Matplotlib Backend

TkAgg

Python version

3.9.7

Jupyter version

N/A

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions