我正在使用Visualstudio 2017,需要添加System.IO.Ports
. 但是,我找不到“添加引用”选项(在解决方案资源管理器的任何右键单击菜单中),也找不到有关如何执行此操作的说明。请帮助?谢谢
我无法使用 ggplot/ggpattern 自定义图例。
谢谢!
代码:
remotes::install_github("coolbutuseless/ggpattern")
library(ggplot2)
library(ggpattern)
list <- c("1" = "circle", "0" = "none")
ggplot(tt) +
aes(x = SOUND, y = R, fill = SPEED, pattern = TYPE) +
geom_boxplot_pattern(pattern_fill = "white",
pattern_density = 0.6,
pattern_spacing = 0.012,
outlier.size = 1) +
scale_pattern_manual(values = list) +
scale_fill_brewer(palette = "Set1") +
labs(y = "R", title = "R") +
ylim(0,100) +
theme_minimal()
Run Code Online (Sandbox Code Playgroud)
数据样本:
structure(list(ID = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, …
Run Code Online (Sandbox Code Playgroud) 我有以下代码。我想更改箱线图的颜色,以便它们都具有相同的填充颜色(灰色)。另外,我想让 stat_summary 文本粘贴到每个条形图的底部,但 vjust 似乎只提供相对位置?
谢谢
boxp <- ggplot(mtcars, aes(as.factor(cyl), wt, fill=as.factor(am)) ) +
geom_bar(position = "dodge", stat = "summary", fun.y = "median") +
geom_boxplot(outlier.shape = NA, width=0.2, color = "black", position = position_dodge(0.9)) +
stat_summary(aes(label=round(..y..,2)), fun.y=median, geom="text", size=8, col = "white", vjust=8, position = position_dodge(0.9)) +
stat_summary(fun.y=mean, geom="point", shape=18, size=4, col="white", position = position_dodge(0.9)) +
labs(x = "Conditions", y = "Medians") +
scale_y_continuous(limits=c(0,7),oob = rescale_none) +
theme_bw()
boxp
Run Code Online (Sandbox Code Playgroud)