I have exported the following ggplot in EPS format.
Unfortunately, when I opened it, the orientation is changed to -90 degrees.
How can I avoid it?
Thanks
library(dplyr, warn.conflicts = FALSE)
library(ggplot2)
df_final=data.frame(
annual_ratio=sample(100,100),
rain_no=sample(100,100),
model=rep(c("model","model2",
"model3","model4","model5","model6",
"model7","model8","model9","model0"),10)
)
P=ggplot(df_final, aes(model, annual_ratio,colour = "yy")) +
geom_boxplot() +
scale_x_discrete(guide = guide_axis(angle = 90))+
theme_bw()+
geom_boxplot(aes(x=model, y=rain_no,colour = "xx"),
data=df_final)+
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.line = element_line(colour = "black"))+
theme(
axis.text = element_text( size = 15, color = "black"),
axis.text.x = element_text( size = 15 , color = "black"),
axis.title = element_text( size = 15)
)+
theme(legend.position = c(0.82, 0.9))+
theme(plot.title = element_text(size = 15, face = "bold"),
legend.title=element_text(size=15),
legend.text=element_text(size=15))+
labs(colour= "Legend")+
scale_y_continuous(
"yy",
sec.axis = sec_axis(~ .,
name = "XX")
)
P
ggsave("Fig.eps",P,width=11, height=8.5,units = "in", dpi=300)