使用plotnine向地物添加圆形文字

2024-10-17 06:27:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用plotnine将循环文本添加到python绘图中。我可以使用geom_text()并更改角度,但这不会使其弯曲。这是我目前掌握的代码:

from plotnine import ggplot, aes, geom_text
p = ggplot(aes(x=[0,10], y=[0,10]))
p = p + geom_text(aes(x = 2, y = 2, angle=-68), label = "Curved text")

下面是我希望文本的样子。R&;ggplot2也会起作用

enter image description here


Tags: 代码textfrom文本import绘图labelaes