如何在R中获得没有网格的矩形主题?
我有以下数据帧:如何在R中获得没有网格的矩形主题?,r,ggplot2,plot,R,Ggplot2,Plot,我有以下数据帧: df = structure(list(Date = structure(c(11690, 11725, 11753, 11781, 11809, 11844, 11872, 11942, 11970, 11998, 12026, 12061, 12089, 12117, 12145, 12180, 12208, 12243, 12299, 12327, 12362, 12390, 12425, 12453, 12481, 12509, 12544, 12572, 126
df = structure(list(Date = structure(c(11690, 11725, 11753, 11781,
11809, 11844, 11872, 11942, 11970, 11998, 12026, 12061, 12089,
12117, 12145, 12180, 12208, 12243, 12299, 12327, 12362, 12390,
12425, 12453, 12481, 12509, 12544, 12572, 12600, 12663), class = "Date"),
Sentiment = c(-0.010752688172043, 0.0375, 0.0317460317460317,
0.0280373831775701, 0.019047619047619, 0.0280373831775701,
0.0253164556962025, 0, -0.025, 0.00684931506849315, -0.010989010989011,
-0.032258064516129, -0.0149253731343284, -0.0172413793103448,
-0.0761904761904762, 0, -0.00555555555555556, 0.0178571428571429,
0.00632911392405063, 0.0217391304347826, 0.088, 0.0344827586206897,
0.0130718954248366, 0.0112359550561798, -0.0164835164835165,
0.00420168067226891, 0.0401785714285714, 0.0338983050847458,
0.0376344086021505, 0.0178571428571429)), row.names = c(NA,
30L), class = "data.frame")
当我使用plot
绘制它时,我得到了没有网格的矩形主题,如下所示:
但是,我无法使用ggplot
找到等效的主题
有人能帮我吗
谢谢 这就是你想要的吗
ggplot(df, aes(x=Date, y=Sentiment)) + geom_point() + theme_classic() +
theme(panel.border = element_rect(fill=NA))
你说的“矩形方案”是什么意思?@user438383我编辑了这个问题,请参考iTunes,
theme\u classic()
只有半个矩形的形状。我想要一个完整的矩形,你可以用主题(panel.border=element\u rect(fill=NA))
手工添加。我不知道是否有这样一个主题。检查我的编辑:)非常感谢!非常有帮助!如果SO允许,我会将其标记为正确:)