我正在尝试在 ggplot2 中创建一个情节。以下是名为 problem_accept_df 的数据:
Order Application probscore
1 Integrated 0.8333333
1 Tabbed 0.7777778
2 Integrated 0.8965517
2 Tabbed 0.7777778
3 Integrated 0.7931034
3 Tabbed 0.7777778
4 Integrated 0.7
4 Tabbed 0.6538462
5 Integrated 0.9285714
5 Tabbed 0.8333333
6 Integrated 0.9310345
6 Tabbed 0.8148148
7 Integrated 0.8571429
7 Tabbed 0.8518519
8 Integrated 0.9333333
8 Tabbed 0.6923077
9 Integrated 0.9310345
9 Tabbed 0.8461538
10 Integrated 0.9285714
10 Tabbed 0.8
这是创建情节的代码:
ggplot(problem_accept_df, aes(x=Order, y=probscore, color=Application,
group=Application)) +
xlab('Order') +
ylab('Problem scores') +
geom_line(position=pd, size=2) +
geom_point(position=pd, size=4) +
labs(title='Acceptable proportion of problem scores')
绘图已创建,但 y 值显示在等间距的刻度线上,即使这些值不是等间距的。该图还显示每个单独的 y 值而不是范围。我试图改变它 ( scale_y_continuous(breaks=seq(0.5, 1, 0.1))
) 但我收到错误消息Error: Discrete value supplied to continuous scale
,所以问题必须更基本。我将不胜感激有关该做什么的任何建议。