r - 在 x 轴线上方有 ggplot2 geom_points
问题描述
我正在尝试创建我的数据图,其中一些点非常靠近(或在顶部)x 轴绘制。我想让这些点显示在轴线的顶部而不是轴线的后面(见图)。 ggplot 在数据点上具有 x 轴线的数据。 这是我的代码。
`myplot2 = ggplot(DataToPlot, aes(x = H297_B, y = H297_B_Depth))+
geom_path(size = 1) +
geom_point(shape = 21, color = 'black', fill = 'blue', size = 3, stroke = 1.5)+
scale_y_continuous(trans = 'reverse', limits = c(1050, 0)) +
scale_x_continuous(position = 'top', limits = c(0, 330)) +
coord_cartesian(clip = 'off', expand = F) +
theme_classic() +
theme(text = element_text(size = 14, family = 'Arial'),
axis.text = element_text(size = 12, family = 'Arial', color = 'black'),
axis.line = element_line(size = 1),
axis.ticks = element_line(size = 1, color = 'black'),) +
labs(x = expression(C-P~Lyase~Activity~(pmol~P~L^{-1}~d^{-1})), y = 'Depth (m)')`
我很感激你能提供的任何建议。
解决方案
推荐阅读
- android - Room:无法访问主线程上的数据库,因为它可能会长时间锁定 UI
- android-studio - 在 Android Studio 上以本机方式构建 OpenCV 时出现 cmake 错误
- angular - 如何在原始 html 中使用 Angular 5 组件
- zip - 压缩后文件大小不减小
- papaparse - 如何将 Papa.parse 结果放入数组
- python - 如何将变量保存在文件中?
- python - 使用索引重建numpy数组
- javascript - 使用 Promise.all 在 Google 地图上放置标记 - 对象作为 React 子级无效(发现:[object Promise])
- r - 具有二分调节器和预测器以及四个连续调节器的调节中介
- javascript - 单击按钮时将图片附加到 div