我试图在ggplot中绘制两条散点线。 x轴是从1到10的整数。最初我写了以下代码:
auto t = std::make_shared<boost::asio::deadline_timer>(ios);
这导致以下情节
此处x轴是连续的,打印值如2.5,7.5。为了使它成为因素,即1,2,3,4,...,10我尝试放library(ggplot2)
Answer <- c(1:10)
EM = c(0.458,0.517,0.4,0.394,0.15,0.15,0.0,0.2,0.14,0.33)
F1 = c( 0.56,0.63,0.632,0.704,0.502,0.524,0.488,0.64,0.5,0.593)
test_data <- data.frame(EM,F1,Answer)
ggplot(test_data, aes(Answer)) +
geom_line(aes(y = EM, colour = "EM")) +
geom_line(aes(y = F1, colour = "F1"))
,但这导致空图。我怎样才能解决这个问题?