r - 位置抖动的 geom_errorbar 问题
问题描述
我正在尝试使用 posistion_jitter 使我的观点不相互重叠。这适用于我的观点,但是当我将 position = position_jitter 应用于 geom_errorbar 时,误差线都被切断并且不在正确的位置。我怎样才能得到它,以便我的误差线与我的点正确对齐?
ggplot(summary_df.phase3_pt2_slope_vals_by_participant_ratio, aes(x = factor(participant_number, level = ratio_part_nums_sorted), y= ratio_error, group=participant_number, legend(size=legend_size))) +
geom_point(aes(color = slope_change, shape = target_distance), size = 6, position = position_jitter(width = .2, height = .2)) +
guides(color = guide_legend(reverse=TRUE)) + scale_color_manual(values = c(color.grey3, color.black)) +
xlab("Participant Number") + ylab("Mean Ratio Error") +
theme(axis.title.x = element_text(size=axis.title_size), axis.title.y = element_text(size=axis.title_size), axis.text.x = element_text(size=axis.text_size), axis.text.y = element_text(size=axis.text_size), plot.title = element_text(size = plot.title_size, hjust = 0.5), legend.title = element_text(color="black", size = legend.title_size),legend.text = element_text(color="black", size = legend.text_size)) +
scale_y_continuous(expand = expansion(mult = c(0, .1)), limits = c(.5,2)) +
geom_errorbar(aes(ymin=ratio_error-std, ymax=ratio_error+std), width=.1, position = position_jitter(width = .2, height = .2)
解决方案
推荐阅读
- qt - QSqlQueryModel 在添加和更新记录后刷新数据的不同行为
- ruby-on-rails - 如何使 Activeadmin 中显示的 URL 可点击
- excel - 如果结果为负,则对每 2 行的结果求和
- c# - Xamarin Forms 使详细视图可编辑
- android - 在多个线程中同时从 Litedb 集合中读取数据时获取 SIGSEGV
- html - 无法将一些损坏的链接变成合格的链接
- python-3.x - 我有不同的 python 版本,我正在使用哪个版本?
- javascript - POST 请求在邮递员中有效,但在浏览器中无效
- docker - 重新启动 auditd 服务会导致依赖错误
- javascript - cancleAnimationFrame 没有停止动画循环