#-- Adhesive shear strength data: multiple line plots  ---

library(tidyverse)
strength.df <- read_csv("./data/chap5/shearstrength.csv")
mylinetypes <- c("solid","twodash","longdash")
mycolors <- c("blue","red","darkgreen")
strength.df1 <- strength.df %>%
  pivot_longer(cols = c('250','260','270'),
               names_to = "temperature",values_to = "strength")
sp <- ggplot(data=strength.df1,aes(x=pressure,y=strength))
sp + 
  geom_line(size=1,aes(linetype=temperature,
                       color=temperature)) +
  scale_linetype_manual(values = mylinetypes) +
  scale_color_manual(values = mycolors) +
  theme_classic() +
  theme(text = element_text(size = 12, colour="black"),
        axis.line = element_line(
          arrow = arrow(type="closed",length = unit(8,'pt'))),
        legend.direction = "horizontal",
        legend.position = c(0.50,0.90)) + 
  scale_x_continuous(limits = c(120,152)) +
  scale_y_continuous(limits = c(8,12),breaks=seq(7,11,1)) +
  labs(x="\nPressure (lb/sq in)\n",
       y="\nAdhesive Shear Strength\n",
       linetype="Temperature: ",color="Temperature: ")
ggsave(filename="./images/chap5/mlineplots.pdf", width = 4.5,
       height = 3.8,units = "in")