Creating beautiful charts in chinese with ggplot2
Before we start
My chinese skills are poor and biased. I did learn during my internship and I continue to study while I can translate "last year our exports were 19,000 USD million" but I don't know all the colors.
I will use this dataset and for the example and you can use any chinese font you want. In this example I'm using Adobe Heiti.
Initial setup
These are the necessary libraries and I did read directly from the xlsx file before defining levels, labels and colors.
- library(XLConnect)
- library(ggplot2)
- library(RColorBrewer)
- library(scales)
- library(plyr)
- library(forcats)
- file <- paste0(getwd(),"/ggplot2_chinese/trade_data_chile_china.xlsx")
- data <- readWorksheetFromFile(file, sheet = "Sheet1", region = "A3:K13", header = TRUE)
- data2 <- readWorksheetFromFile(file, sheet = "Sheet1", region = "A17:F27", header = TRUE)
- data3 <- readWorksheetFromFile(file, sheet = "Sheet1", region = "A30:C35", header = TRUE)
- data4 <- readWorksheetFromFile(file, sheet = "Sheet1", region = "A39:E59", header = TRUE)
- data5 <- readWorksheetFromFile(file, sheet = "Sheet1", region = "A62:G72", header = TRUE)
- data6 <- readWorksheetFromFile(file, sheet = "Sheet1", region = "A75:C125", header = TRUE)
- data <- as.data.frame(data)
- data2 <- as.data.frame(data2)
- data3 <- as.data.frame(data3)
- data3$country <- factor(data3$country, levels = c("china","usa","eu","japan","korea"), labels = c("中国","美国","欧盟","日本","朝鲜"))
- data4 <- as.data.frame(data4)
- data4$product <- factor(data4$product, levels = c("copper","others"), labels = c("铜","木浆, 水果, 鱒屬和等产品"))
- data4 <- ddply(data4, .(year), transform, pos = cumsum(percentage) - (0.5 * percentage))
- data4 <- ddply(data4, .(year), transform, pos2 = cumsum(exports) - (0.5 * exports))
- data5 <- as.data.frame(data5)
- data6 <- as.data.frame(data6)
- data6$product <- factor(data6$product, levels=c("fruits", "processedfoods", "bottledwine", "salmon", "forestryandfurniture"), labels=c("水果", "再制", "瓶装酒", "鱒屬", "林业和木家具"))
- brewer.pal(8, "Paired")
- [1] "#A6CEE3" "#1F78B4" "#B2DF8A" "#33A02C" "#FB9A99" "#E31A1C" "#FDBF6F"
- [8] "#FF7F00"
- cbPalette <- c("#1F78B4", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#556b2f", "#D55E00", "#CC79A7")
- cbPalette2 <- c("#4169e1", "#d68a59","#556b2f", "#FB9A99", "#33A02C")
- cbPalette3 <- c("#F0E442", "#56B4E9")
The charts
Here are different charts that I did create during my internship. These charts are actually "updated" as we still don't have 2016 official trade reports.
I will show how to use the new subtitles functionality in ggplot2 v2.2.0.
- g1 <- ggplot() +
- geom_bar(aes(y = percentage, x = country, fill = country), data = data3, stat="identity") +
- scale_fill_manual(values=cbPalette2) +
- geom_text(data=data3, aes(x = country, y = (percentage + 2), label = paste0(percentage,"%")), colour="black", family="AdobeHeitiStd-Regular", size = 5) +
- scale_y_continuous(breaks=seq(0,40,5), labels = dollar_format(suffix = "%", prefix = "")) + expand_limits(y=c(0,25)) +
- labs(x="",y="百分数") +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- theme(legend.position="none", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("2015年领先的出口市场",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"),
- text=element_text(size=18, family="AdobeHeitiStd-Regular"),
- axis.text.x=element_text(colour="black"))
- g1
- g2 <- ggplot() +
- geom_bar(aes(y = pcentexports, x = year, fill = "pcentexports"), data = data5, stat="identity") +
- scale_fill_manual(values="#4169e1") +
- geom_text(data=data5, aes(x = year, y = pcentexports +2, label = paste0(pcentexports,"%")), colour="black", family="AdobeHeitiStd-Regular", size = 5) +
- scale_x_continuous(breaks=seq(2006,2015,1)) + scale_y_continuous(breaks=seq(0,25,5), labels = dollar_format(suffix = "%", prefix = "")) +
- expand_limits(y=c(0,25)) + labs(x="年",y="百分数") +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- theme(legend.position="none", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("出口中国的产品的结构",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular"))
- g2
- g3 <- ggplot() +
- geom_bar(aes(y = pcentimports, x = year, fill = "pcentimports"), data = data5, stat="identity") +
- scale_fill_manual(values="#000080") +
- geom_text(data=data5, aes(x = year, y = pcentimports +2, label = paste0(pcentimports,"%")), colour="black", family="AdobeHeitiStd-Regular", size = 5) +
- scale_x_continuous(breaks=seq(2006,2015,1)) +
- scale_y_continuous(breaks=seq(0,25,5), labels = dollar_format(suffix = "%", prefix = "")) +
- expand_limits(y=c(0,25)) + labs(x="年",y="百分数") +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- theme(legend.position="none", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("进口中国的产品的结构",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular"))
- g3
- g4 <- ggplot() +
- geom_bar(aes(y = percentage, x = year, fill = fct_rev(product)), data = data4, stat="identity") +
- scale_fill_manual(values=cbPalette3) + geom_text(data=data4, aes(x = year, y = pos, label = paste0(percentage,"%")), colour="black", family="AdobeHeitiStd-Regular", size = 4) +
- scale_x_continuous(breaks=seq(2006,2015,1)) +
- scale_y_continuous(labels = dollar_format(suffix = "%", prefix = "")) +
- labs(x="年", y="百分数") + theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("出口中国结构 (%)",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular"))
- g4
- g5 <- ggplot() +
- geom_bar(aes(y = exports, x = year, fill = fct_rev(product)), data = data4, stat="identity") +
- scale_fill_manual(values=cbPalette3) + geom_text(data=data4, aes(x = year, y = pos2, label = exports), colour="black", family="AdobeHeitiStd-Regular", size = 4) +
- scale_x_continuous(breaks=seq(2006,2015,1)) +
- labs(x="年", y="百万美元") +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("出口中国结构 ($)",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular"))
- g5
- g6 <- ggplot() +
- geom_area(aes(y = exports, x = year, fill = fct_rev(product)), data = data6, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) +
- scale_y_continuous(breaks=seq(0,1600,400)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_fill_brewer(palette="Paired") +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("无铜矿或造纸木材出口中国",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular"))
- g6
- g7 <- ggplot() +
- geom_line(aes(y = exportscc, x = year, colour = "exportscc"), size=1.5, data = data, stat="identity") +
- geom_line(aes(y = importscc, x = year, colour = "importscc"), size=1.5, data = data, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) +
- scale_y_continuous(breaks=seq(0,20000,5000)) +
- expand_limits(y=c(5000,20000)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("出口的产品", "进口产品"), values = c("#4169e1", "#000080")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("商业智利-中国",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) + guides(col = guide_legend(nrow = 2))
- g7
- g8 <- ggplot() +
- geom_line(aes(y = exportscusa, x = year, colour = "exportscusa"), size=1.5, data = data, stat="identity") +
- geom_line(aes(y = importscusa, x = year, colour = "importscusa"), size=1.5, data = data, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) +
- scale_y_continuous(breaks=seq(0,20000,5000)) +
- expand_limits(y=c(5000,20000)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("出口的产品", "进口产品"), values = c("#a0522d", "#E18942")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("商业智利-美国",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) +
- guides(col = guide_legend(nrow = 2))
- g8
- g9 <- ggplot() +
- geom_line(aes(y = exportsceu, x = year, colour = "exportsceu"), size=1.5, data = data, stat="identity") +
- geom_line(aes(y = importsceu, x = year, colour = "importsceu"), size=1.5, data = data, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) +
- scale_y_continuous(breaks=seq(0,20000,5000)) +
- expand_limits(y=c(5000,20000)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("出口的产品", "进口产品"), values = c("#556b2f", "#2f556b")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("商业智利-欧盟",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) +
- guides(col = guide_legend(nrow = 2))
- g9
- g10 <- ggplot() +
- geom_line(aes(y = bccc, x = year, colour = "bccc"), size=1.5, data = data2, stat="identity") +
- geom_line(aes(y = bccw, x = year, colour = "bccw"), size=1.5, data = data2, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("淨出口中国的产品", "淨出口人间的产品"), values = c("#4169e1", "#FF43A4")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("淨出口中国和人间",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) + guides(col = guide_legend(nrow = 2))
- g10
- g11 <- ggplot() +
- geom_line(aes(y = bccusa, x = year, colour = "bccusa"), size=1.5, data = data2, stat="identity") +
- geom_line(aes(y = bccw, x = year, colour = "bccw"), size=1.5, data = data2, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) + scale_y_continuous(breaks=seq(-10000,25000,5000)) +
- expand_limits(y=c(-10000,25000)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("淨出口美国的产品", "淨出口人间的产品"), values = c("#d68a59", "#FF43A4")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("淨出口美国和人间",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) + guides(col = guide_legend(nrow = 2))
- g11
- g12 <- ggplot() +
- geom_line(aes(y = bcceu, x = year, colour = "bcceu"), size=1.5, data = data2, stat="identity") +
- geom_line(aes(y = bccw, x = year, colour = "bccw"), size=1.5, data = data2, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("淨出口人间的产品", "淨出口欧盟的产品"), values = c("#FF43A4", "#556b2f"), guide = guide_legend(reverse=TRUE)) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("淨出口欧盟和人间",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) +
- guides(col = guide_legend(nrow = 2))
- g12
- g13 <- ggplot() +
- geom_line(aes(y = exportscc, x = year, colour = "exportscc"), size=1.5, data = data, stat="identity") +
- geom_line(aes(y = exportscusa, x = year, colour = "exportscusa"), size=1.5, data = data, stat="identity") +
- geom_line(aes(y = exportsceu, x = year, colour = "exportsceu"), size=1.5, data = data, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) + scale_y_continuous(breaks=seq(0,20000,5000)) + expand_limits(y=c(5000,20000)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("中国(第一贸易合作伙伴)出口智利的产品", "美国(第二贸易合作伙伴)出口智利的产品", "欧盟(第三贸易合作伙伴)出口智利的产品"), values = c("#4169e1", "#d68a59","#556b2f")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("出口中国,美国和欧盟的产品",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) +
- guides(col = guide_legend(nrow = 3))
- g13
- g14 <- ggplot() +
- geom_line(aes(y = importscc, x = year, colour = "importscc"), size=1.5, data = data, stat="identity") +
- geom_line(aes(y = importscusa, x = year, colour = "importscusa"), size=1.5, data = data, stat="identity") +
- geom_line(aes(y = importsceu, x = year, colour = "importsceu"), size=1.5, data = data, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) +
- scale_y_continuous(breaks=seq(4000,20000,4000)) +
- expand_limits(y=c(4000,20000)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("中国(第一贸易合作伙伴)进口智利的产品", "美国(第二贸易合作伙伴)进口智利的产品", "欧盟(第三贸易合作伙伴)进口智利的产品"), values = c("#4169e1", "#d68a59","#556b2f")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("从中国,美国和欧盟进口产品",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) +
- guides(col = guide_legend(nrow = 3))
- g14
- g15 <- ggplot() +
- geom_line(aes(y = bccc, x = year, colour = "bccc"), size=1.5, data = data2, stat="identity") +
- geom_line(aes(y = bccusa, x = year, colour = "bccusa"), size=1.5, data = data2, stat="identity") +
- geom_line(aes(y = bcceu, x = year, colour = "bcceu"), size=1.5, data = data2, stat="identity") +
- xlab("年") + ylab("百万美元") +
- scale_x_continuous(breaks=seq(2000,2015,3)) +
- scale_y_continuous(breaks=seq(-10000,15000,5000)) +
- expand_limits(y=c(-10000,15000)) +
- theme(panel.background = element_rect(fill="white"), panel.grid = element_line(colour="white")) +
- scale_color_manual(labels = c("中国(第一贸易合作伙伴)淨出口智利的产品", "美国(第二贸易合作伙伴)淨出口智利的产品", "欧盟(第三贸易合作伙伴)淨出口智利的产品"), values = c("#4169e1", "#d68a59","#556b2f")) +
- theme(legend.position="bottom", legend.direction="horizontal", legend.title = element_blank(), axis.line.x = element_line(size=1.0), axis.line.y = element_line(size=1.0)) +
- ggtitle("淨出口中国,美国和欧盟进口产品",
- subtitle = "消息灵通人士: 智利海关总署, 智利中央银行 & 商務處智利中國") +
- theme(plot.title=element_text(size=20, family="AdobeHeitiStd-Regular"), text=element_text(size=18, family="AdobeHeitiStd-Regular")) +
- guides(col = guide_legend(nrow = 3))
- g15
转自: http://pacha.hk/ggplot2_chinese.html
Creating beautiful charts in chinese with ggplot2的更多相关文章
- R绘图 第九篇:绘制散点图和气泡图(ggplot2)
绘制散点图(scatterplots)使用geom_point()函数,气泡图(bubblechart)也是一个散点图,只不过点的大小由一个变量(size)来控制.散点图潜在的最大问题是过度绘图:当一 ...
- Python框架、库以及软件资源汇总
转自:http://developer.51cto.com/art/201507/483510.htm 很多来自世界各地的程序员不求回报的写代码为别人造轮子.贡献代码.开发框架.开放源代码使得分散在世 ...
- Awesome Python
Awesome Python A curated list of awesome Python frameworks, libraries, software and resources. Insp ...
- Machine and Deep Learning with Python
Machine and Deep Learning with Python Education Tutorials and courses Supervised learning superstiti ...
- Python开源框架、库、软件和资源大集合
A curated list of awesome Python frameworks, libraries, software and resources. Inspired by awesome- ...
- 【python】Python框架、库和软件资源大全
很多来自世界各地的程序员不求回报的写代码为别人造轮子.贡献代码.开发框架.开放源代码使得分散在世界各地的程序员们都能够贡献他们的代码与创新. Python就是这样一门受到全世界各地开源社区支持的语言. ...
- Python 库汇总英文版
Awesome Python A curated list of awesome Python frameworks, libraries, software and resources. Insp ...
- Python框架、库和软件资源大全(整理篇)
有少量修改,请访问原始链接.PythonWIn的exe安装包;http://www.lfd.uci.edu/~gohlke/pythonlibs/ 原文链接:codecloud.net/python- ...
- wesome-android
awesome-android Introduction android libs from github System requirements Android Notice If the lib ...
随机推荐
- Entity Framework快速入门--IQueryable与IEnumberable的区别
IEnumerable接口 公开枚举器,该枚举器支持在指定类型的集合上进行简单迭代.也就是说:实现了此接口的object,就可以直接使用foreach遍历此object: IQueryable 接口 ...
- SVG格式转Visio的vsd格式方法,附带C#动态调用Office的Com组件方法
SVG格式可以直接显示在网页上面,用来实现诸如统计Chart图表.流程图.组织结构图的功能.为了使图像可以下载下来以便于修改,可以将SVG转为Visio的vsd格式.方法很简单,主要是使用Visio组 ...
- Sitemesh 3 配置和使用(最新)
Sitemesh 3 配置和使用(最新) 一 Sitemesh简介 Sitemesh是一个页面装饰器,可以快速的创建有统一外观Web应用 -- 导航 加 布局 的统一方案~ Sitemesh可以拦截任 ...
- 自定义TextView跑马灯
本篇主要介绍TextView的可控制跑马灯效果实现. Android自带的TextView添加几个属性就可以实现跑马灯效果,大概是这样 android:ellipsize="marquee& ...
- python基础教程第二版 第一章
1.模块导入python以增强其功能的扩展:三种方式实现 (1). >>> Import math >>> math.floor(32.9) 32.0 #按照 模块 ...
- C++STL vector详解(杂谈)
介绍 这篇文章的目的是为了介绍std::vector,如何恰当地使用它们的成员函数等操作.本文中还讨论了条件函数和函数指针在迭代算法中使用,如在remove_if()和for_each()中的使用.通 ...
- (练习题)利用构造器函数实现三个小实例——不使用String()与Array()构造器和Math对象,不使用内建的方法的方法和属性。
1)在String()构造器不存在的情况下自定义一个myString()构造器函数.由于String()不存在,因此您在写构造器函数时不能使用任何属于内建String对象的方法和属性.并让你所创建的对 ...
- unity静态批处理原理理解
今天主程给我好好讲了一下静态批处理的问题,记下来的笔记心得~ 1.静态批处理的时间点 1)在游戏导出的时候,在player setting中勾选static batching,这样在导出包的时候就进行 ...
- GBDT与LR融合提升广告点击率预估模型
1GBDT和LR融合 LR模型是线性的,处理能力有限,所以要想处理大规模问题,需要大量人力进行特征工程,组合相似的特征,例如user和Ad维度的特征进行组合. GDBT天然适合做特 ...
- TPshop分销功能的使用与表设计
首先来段科普,摘自百度百科: 在西方经济学中,分销 的含义是建立销售渠道的意思,根据著名的营销大师菲利普·科特勒的定义,分销渠道(Distribution Channel)又或者叫营销渠道(Marke ...