我想要画一个图表,在一个轴上呈现1,000个成语(轴范围从1-5。轴标是成语。例如。
下雨猫和dogs........make excuse................raise一个问题
|---------------------------------|------------------------------| 1....................................................3................................................5
我遇到了四个问题:
我利用related的绘图函数在How to plot a single value on an axis in ggplot2?中找到了一个相关的解决方案。但这并不能解决我所有的问题。请帮帮忙。
发布于 2022-10-04 08:09:20
idioms <- data.frame(rating = runif(1000, 1, 5))
ggplot(idioms, aes(rating, 0)) +
geom_jitter() +
scale_x_continuous(breaks = c(1,3,5),
labels = c("raining cats and dogs",
"\nmake an excuse", # manual vertical dodge
"raise a question")) +
# this is all just aesthetics
theme_minimal() +
theme(axis.text.y = element_blank(),
panel.grid.major.y = element_blank(),
panel.grid.minor.x = element_blank(),
axis.title.y = element_blank(),
axis.text.x = element_text(hjust = c(0,0.5,1)))

https://stackoverflow.com/questions/73943443
复制相似问题