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

Continued Text Alignment Issues #1742

Closed
Assignees
leejjoon
Milestone
@pmarshwx

Description

@pmarshwx

When using AnchoredText, setting the horizontal alignment to 'center' causes the text to be centered around the left-most edge of the text space. In other words, the text is being centered around the location of the the left spine of the text box plus the padding amount.

If you try to right-align the text, the entire text is actually found to the left of the text box.

Here's a simple example and figure to illustrate. Note, this works with or without ImageGrid.

import matplotlib.pyplot as pltfrom mpl_toolkits.axes_grid1 import ImageGridfrom mpl_toolkits.axes_grid.anchored_artists import AnchoredTextfig = plt.figure()# grid = ImageGrid(fig, 111, nrows_ncols=(1,1))# ax0 = grid[0]ax0 = fig.add_subplot(111)title = 'Test Test Test Test Test'at = AnchoredText(title, prop=dict(size=24, horizontalalignment='center'),                  frameon=True, loc=9, borderpad=0.5, pad=0.5)at.patch.set_boxstyle("round, pad=0, rounding_size=0.25")ax0.add_artist(at)plt.show()

tmp

Here are a couple of issues and pull requests thatcould be related.

Issue#1571
Pull Request#1081
Pull Request#1589

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp