重新创建没有数据的绘图

标签 r ggplot2

有没有办法在没有任何数据的情况下创建类似于下图的图形?

enter image description here

最佳答案

你可以做这样的事情。您可以添加另一个 geom_curve 和几个 geom_vline

library(tidyverse)

ggplot() +
  geom_abline() +
  geom_curve(aes(x = 0, y = 0, xend = 1, yend = 1), curvature = -0.4) +
  annotate("text", x = 0.5, y = 0.5, label = "Line of Equality", angle = 35, vjust = 2) +
  labs(x = "Individuals Neighbourhoods\nAcross Space", y = "Scoioeconomic Position") +
  theme_minimal() +
  theme(axis.text = element_blank())

reprex package 于 2022-04-27 创建(v2.0.1)

关于重新创建没有数据的绘图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72031074/

相关文章:

r - 如何使用 bind_rows() 并忽略列名

r - Amazon Elastic MapReduce 上的 R 映射器脚本故障排除 - 结果不符合预期

r - 曲线错误(): 'expr' did not evaluate to an object of length 'n'

r - ggplot2 中两种美学和 geom_abline 的图例

r - 指数加权移动平均线的快速 R 实现?

list - 可以给自己添加一个 data.frame 吗?

r - R : barchart with log scale label misplacement 中的 ggplot

python - 如何在 Python 中使用 scale_color_manual?

r - 通过 modelplot() 的正/负值更改绘图颜色

r - 具有多列的计数数据的条形图