Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

立方柱形图 #6

Closed
XiangyunHuang opened this issue Aug 27, 2017 · 1 comment
Closed

立方柱形图 #6

XiangyunHuang opened this issue Aug 27, 2017 · 1 comment

Comments

@XiangyunHuang
Copy link
Collaborator

XiangyunHuang commented Aug 27, 2017

立方柱形图有时候也可用棋盘图代替,理由是如果俯视柱形图看到的就是下面这样,如下
viridis
spectral
同时也要注意颜色的区分度,这里第二张图更好区别

@XiangyunHuang
Copy link
Collaborator Author

XiangyunHuang commented Aug 27, 2017

dat <- as.data.frame( cbind(rep( 1948 + seq(12), each = 12), rep(seq(12),12), AirPassengers) )  
colnames(dat) <- c("year","month","passengers")
library(ggplot2)

pdf(file="AirlinePassenger.pdf")
ggplot(data = dat, aes(as.factor(year), as.factor(month))) + 
    geom_point(pch = 15,size = 8 ,aes(colour = passengers )) +
	scale_colour_distiller(palette = "Spectral") +
	labs(x = "Year",y = "Month",colour = "Passengers") +
	theme_bw()
	
library(colormap)	
ggplot(data = dat, aes(as.factor(year), as.factor(month))) + 
    geom_point(pch = 15,size = 8 ,aes(color = passengers )) +
	scale_color_colormap(colormap = colormaps$viridis) +
	labs(x = "Year",y = "Month",colour = "Passengers") +
	theme_bw()	
dev.off()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant