【问题标题】:Write a Circumflex Larger in Python用 Python 写一个更大的 Circumflex
【发布时间】:2021-05-18 14:15:37
【问题描述】:

我可以在 Python 中将 'A circumflex' 写为图表上的标签:

df = pd.DataFrame({'x':(0,3,4,0),'y':(3,0,4,3)})

fig, ax = plt.subplots(1,1)

df.plot(x='x', y='y', ax=ax, label='A\u0302', linewidth=5, color='k', linestyle='-')

for item in ([ax.title, ax.xaxis.label, ax.yaxis.label] +
             ax.get_xticklabels() + ax.get_yticklabels()):
    item.set_fontsize(22)

legend = ax.legend(loc=0, ncol=1, bbox_to_anchor=(0.9, -.3, .6, 1),
           fancybox=True, shadow=False,
           framealpha=1, fontsize=22)

plt.setp(legend.get_title(),fontsize=22)

这给出了:

请问怎样才能让音圈变大?

【问题讨论】:

  • 可能是$\^{A}$?
  • 是,或$\hat{A}$

标签: python pandas matplotlib unicode font-size


【解决方案1】:

感谢 T & tmdavison 先生,$^{A}$$\hat{A}$ 出于某种原因工作:

df = pd.DataFrame({'x':(0,3,4,0),'y':(3,0,4,3)})

fig, ax = plt.subplots(1,1)

df.plot(x='x', y='y', ax=ax, label='$A\u0302$', linewidth=5, color='k', linestyle='-')
df.plot(x='x', y='y', ax=ax, label='$\^{A}$',   linewidth=5, color='k', linestyle='-')
df.plot(x='x', y='y', ax=ax, label='$\hat{A}$', linewidth=5, color='k', linestyle='-')

for item in ([ax.title, ax.xaxis.label, ax.yaxis.label] +
             ax.get_xticklabels() + ax.get_yticklabels()):
    item.set_fontsize(22)

legend = ax.legend(loc=0, ncol=1, bbox_to_anchor=(0.9, -.3, .6, 1),
           fancybox=True, shadow=False,
           framealpha=1, fontsize=22)

plt.setp(legend.get_title(),fontsize=22)

【讨论】:

  • 您也可以尝试'Â' 的单个代码点(或等效的'\xc2''\N{LATIN CAPITAL LETTER A WITH CIRCUMFLEX}'。显示引擎可能无法处理分解的代码点。
猜你喜欢
  • 2021-11-23
  • 2011-04-02
  • 2012-09-24
  • 2018-01-10
  • 1970-01-01
  • 2018-04-03
  • 2016-09-04
  • 1970-01-01
  • 2016-06-29
相关资源
最近更新 更多