setwd("C:/Users/PAULA/Desktop/Datos doctorado/inercia/Archivos para paper")

require(ggplot2)
library(tidyr)
library(dplyr)
read.csv("Nasshalfhour3dec.csv")
my.data<-read.csv("Nasshalfhour3dec.csv")
my.data$Fecha <- as.POSIXct(my.data$Fecha, format="%d/%m/%Y %H:%M")
long.data <- my.data %>%
  pivot_longer(cols = c(N1, N5, N12),
               names_to = "Sensor",
               values_to = "Value")
long.data$Sensor <- factor(long.data$Sensor, 
                           levels = c("N1", "N5", "N12"))

ggplot(long.data, aes(x = Fecha, y = Value, color = Sensor, shape = Sensor)) +
  geom_line(linewidth = 1) +
  geom_point(size = 2) +
  scale_color_manual(
    values = c("N1" = "black", "N5" = "grey20", "N12" = "grey60"),
    name = "Sensor"
  ) +
  scale_shape_manual(
    values = c("N1" = 16, "N5" = 17, "N12" = 15),
    name = "Sensor"
  ) +
  labs(x = "Time",
       y = "Temperature (°C)") +
  theme_minimal() +
  theme(
    axis.text.x = element_text(angle = 45, hjust = 1),
    legend.position = "bottom"
  )