Last active
June 11, 2016 09:01
-
-
Save soh-i/6332270 to your computer and use it in GitHub Desktop.
ggplotの図を透明背景にする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g <- ggplot( | |
data, | |
aes(x=Precision, y=Recall)) + | |
geom_point(aes(colour=Label), size=8, shape=19) + | |
ylim(0,1) + | |
xlim(0,1) + | |
labs( | |
x="Precision", | |
y="Recall" | |
) + | |
scale_colour_brewer(palette="Set2") + | |
theme_classic(base_size=20, base_family="Helvetica") + | |
coord_fixed(ratio=1) + | |
theme(axis.line.x=element_line(size=1), | |
axis.line.y=element_line(size=1), | |
axis.ticks.x=element_line(size=1), | |
axis.ticks.y=element_line(size=1), | |
axis.text.y=element_text(size=18), | |
axis.text.x=element_text(size=18), | |
legend.key=element_rect(fill="transparent", colour="transparent"), | |
plot.background=element_rect(fill="transparent", colour="transparent"), | |
legend.background=element_rect(fill="transparent", colour="transparent"), | |
panel.background=element_rect(fill="transparent", colour="transparent") | |
) | |
plot(g) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# keynoteとか背景色がある場所に貼り付けるときに便利。 | |
theme( | |
legend.key=element_rect(fill="transparent", colour="transparent"), | |
plot.background=element_rect(fill="transparent", colour="transparent"), | |
legend.background=element_rect(fill="transparent", colour="transparent"), | |
panel.background=element_rect(fill="transparent", colour="transparent") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment