matplotlib文本中的无形符号

发布于 2025-02-01 11:13:52 字数 147 浏览 1 评论 0原文

我正在寻找一种在字符串的末端放置到matplotlib文本的末端放置一个无形符号(或空格)的方法,即

ax.text(1.0, 1.0, 'xxx: ')

,显然Matplotlib会自动剥离所有字符串。我该怎么做?

I'm looking for a way to put an invisible symbol (or whitespace) at the end of the string passed to matplotlib text, i.e.

ax.text(1.0, 1.0, 'xxx: ')

but, apparently matplotlib automatically strip all the strings. How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧人哭 2025-02-08 11:13:52

看起来Matplotlib不会剥离文本字符串。

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

ax.text(1, 1, 'xxx:       ', ha='right')

Looks like matplotlib does not strip text string.

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

ax.text(1, 1, 'xxx:       ', ha='right')

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文