library(maps)
library(mapdata)
library(ggplot2)
FijiMap <- map_data("worldHires", region = "Fiji" )
library(sysfonts)
font_add( 'SourceHanSerifCN-Bold', regular = 'C:/Windows/fonts/SourceHanSerifCN-Bold.otf')
font_add( 'SourceHanSerifCN-Regular', regular = 'C:/Windows/fonts/SourceHanSerifCN-Regular.otf')
cairo_pdf(filename = 'Fiji_earthquake.pdf',width = 8,height = 6)
ggplot(FijiMap, aes( x = long, y = lat)) +
geom_map( map = FijiMap, aes(map_id = region),size =.2 ) +
geom_point(data = quakes, aes(x = long, y = lat,colour = mag),pch = 16) +
xlim(160, 195) +
scale_colour_distiller(palette = "Spectral") +
scale_y_continuous(breaks=(-18:18)*5) +
coord_map("ortho", orientation = c(-10,180,0)) +
labs(colour = "震级",x = "经度",y = "纬度",title = '斐济地震带') +
theme_minimal() +
theme(title = element_text( family = "SourceHanSerifCN-Bold" ),
axis.title = element_text( family = "SourceHanSerifCN-Regular" ),
legend.title = element_text( family = "SourceHanSerifCN-Bold" ),
legend.position = c(1,0), legend.justification = c(1,0))
dev.off()