gpt4 book ai didi

R ggplot注释对齐

转载 作者:行者123 更新时间:2023-12-04 07:56:58 31 4
gpt4 key购买 nike

我正在尝试创建注释并对齐它。如果我使用:

annotate("text", label = "atext", x = 1, y = 1)

文本的中心 (e) 位于 (1, 1)。但是,我希望文本(a)的左边框位于 (1, 1)。我该如何做到这一点?

最佳答案

使用 hjust 进行水平对齐。

annotate("text", label = "atext", x = 1, y = 1, hjust = 0)

vjust and hjust获取更多信息;

这是一张图表,显示了上述参数的不同值如何控制调整(和角度)。

hjust, vjust and angle

关于R ggplot注释对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44269663/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com