Skip to content

[ENH]: text with custom width #29570

@chaffra

Description

@chaffra

Problem

I would like to be able to do

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

text = ax.text(0.5, 0.5, "Hello World!", 
                ha="center", va="center", 
                bbox=dict(boxstyle="round", 
                          ec="black", 
                          fc="lightblue", 
                          width=150)) # Set custom width here

plt.show()

but this results in a bug in creating FancyBboxPatch. I think width and height should be implemented as keywords when creating a text for cases where the user would like to make to text box larger for example.

Proposed solution

No response

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