rm(list=ls())
options(warn = -1)
suppressPackageStartupMessages(library(knitr))
suppressPackageStartupMessages(library(cowplot))
suppressPackageStartupMessages(library(gridExtra))
suppressPackageStartupMessages(library(png))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(kableExtra))
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(vioplot))
suppressPackageStartupMessages(library(googleVis))
suppressPackageStartupMessages(library(reticulate))
suppressPackageStartupMessages(library(patchwork))
suppressPackageStartupMessages(library(egg))
suppressPackageStartupMessages(library(ggvis))
#############################################################################
old=theme_set(theme_bw()+theme(strip.background = element_rect(fill="white"),
panel.background = element_blank(),
panel.grid =element_blank()))
# 注意这个赋值语句,尽管这是一个赋值操作,看似对程序没有任何影响,但是这个语句其实起着ggplot的设置初始化的作用
# 不运行这句话,导致最终的图是灰色背景且有网格线的,需要特别注意
#############################################################################
options(repr.plot.width=12,repr.plot.height=5)
gg_color服务器托管网_hue
library(readxl)
options(repr.plot.width=10,repr.plot.height=5)
file_path="../comparison.xlsx"
data_para_hvg= read_xlsx(file_path,"para_hvg")
data = data_para_hvg[2:8,服务器托管网10:12]
colnames(data)=c("HVG","NMI","ARI")
data = data[-c(1),]
data = data.frame(data)
data_NMI = data[,c(1,2)]
data_NMI["type"] = "NMI"
colnames(data_NMI)[2] = "value"
#print(data_NMI)
data_ARI = data[,c(1,3)]
data_ARI["type"] = "ARI"
colnames(data_ARI)[2] = "value"
#print(data_ARI)
data = rbind(data_NMI,data_ARI)
data$value = as.numeric(data$value)
shapes
结果如下
解决办法
library(showtext)
font_add("songti","Songti.ttc")
#font_add('Arial','/Library/Fonts/Arial.ttf') #加载字体,MAC 中字体库在 /Library/Fonts
showtext_auto()
这里注意我的电脑显示/Library/Fonts/的目录内容如下
library(readxl)
options(repr.plot.width=10,repr.plot.height=5)
file_path="../comparison.xlsx"
data_para_hvg= read_xlsx(file_path,"para_hvg")
data = data_para_hvg[2:8,10:12]
colnames(data)=c("HVG","NMI","ARI")
data = data[-c(1),]
data = data.frame(data)
data_NMI = data[,c(1,2)]
data_NMI["type"] = "NMI"
colnames(data_NMI)[2] = "value"
#print(data_NMI)
data_ARI = data[,c(1,3)]
data_ARI["type"] = "ARI"
colnames(data_ARI)[2] = "value"
#print(data_ARI)
data = rbind(data_NMI,data_ARI)
data$value = as.numeric(data$value)
shapes
注意这个地方我在画图中使用的是
text = element_text(family=‘STHeiti’)
这个是宋体和黑体,不过这个没报错,是可以正常保存的,
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
什么是Redis?它的特点是什么? 基于内存的非关系型数据库; 它具有以下特点: 高性能:Redis是基于内存的数据库,读写速度非常快,适合处理高并发的应用场景。 支持持久化:Redis支持两种持久化方式,分别是RDB和AOF,可以保证数据不丢失。 多种数据结…