ggplot(data=iris)+geom_point(mapping=aes(x=Sepal.Length,y=Petal.Length,color=Species),shape=24,fill="black")#24号,双色的例子 代码语言:javascript 代码运行次数:0 运行 AI代码解释 ggplot(data=iris,mapping=aes(x=Species,y=Sepal.Width,color=Species))+geom_boxplot() 代码语言:javascript 代码运行...
library(ggplot2) df <- data.frame(Time = 1:10, Temp_c = c(0, 10, 20, 30, 40, ...
然后就可以各显神通画地图了,我一般还是用ggplot外加ggthemes来画这种地图,毕竟最方便:ggplot() + g...
(sites <- data.frame(longitude = c(-80.144005, -80.109), latitude = c(26.479005, 26.83))) ggplot(data = world) + geom_point(data = sites, aes(x = longitude, y = latitude), size = 4, shape = 23, fill = "darkred") + coord_sf(xlim = c(-88, -78), ylim = c(24.5, 33)...
ggplot (sah, aes (x = ageYear, y = heightIn, shape = sex)) + # 散点图函数 geom_point () 1. 2. 3. 4. 运行结果: 说明:可自定义点形,共有大概36种点形可供选择。具体请参考R语言ggplot2手册。 映射连续型变量 本例选用如下测试数据集: ...
ggplot(pcm, aes(x = variable, y = station)) + geom_point(aes(fill=value*100,size=value*100),alpha = 0.5, shape = 21) + coord_fixed(ratio=1) + labs( x= "month", y = "station", size = "Percentage", fill ="Percentage") + ...
plot_model(threeway,type="int",title="The threeway plot that does not work",show.legend=TRUE,transform="plogis",show.values=TRUE,dot.size=5,line.size=1.5,value.offset=0,colors=c("#333333","#666666","black"))+scale_shape_manual(values=c(15,16,17))+aes(color=group...
gg <- ggplot(midwest,aes(x=area,y=poptotal)) + #首先我们先在ggplot2中最底层定义我们想要使用的数据 geom_point(aes(col=state,size=popdensity)) + #在这个图层中我们给不同的州定义不同的颜色,不同的人口密度点的大小不同 #labs可以定义图及坐标轴的名称,subtitl为副标题 ...
ggplot(raschdat1.long, aes(x = tot, y = ability)) + geom_point(shape = 1, size = 2) + geom_line() + scale_x_continuous(breaks = 1:26) + theme_classic() 问题均方拟合 对于infit MSQ,执行相同的计算。 eRm: ggplot(item.fit.df, aes(x = mml, y = cml)) + scale_x_continuous...
[df_pc$Species == "versicolor", ] # df for 'versicolor' # Plot --- ggplot(df_pc, aes(PC1, PC2, col=Species)) + geom_point(aes(shape=Species), size=2) + # draw points labs(title="Iris Clustering", subtitle="With principal components PC1 and PC2 as X and Y axis", caption...