擅长:python、mysql、java
<p>您还没有显示您正在使用的实际代码,但我认为您需要的是这样的代码:</p>
<pre><code>def render_text(comma_delimited_rect: str, plot: matplotlib.pyplot):
box_coordinates = comma_delimited_rect.strip().split(',')
x = int(box_coordinates[0].strip())
y = int(box_coordinates[1].strip())
plot().text(x, y-10, word["text"], fontsize=8)
</code></pre>
<p>。。。打电话给。。。你知道吗</p>
<pre><code>render_text(word["boundingBox"], plt.gca)
</code></pre>
<p>请注意如何将绘图函数<em>作为函数</em>传递,而不是作为无括号调用的结果传递。你知道吗</p>