final <- final +
# termica renovable text
annotation_custom(
grob = textGrob(
"Térmica \nrenovable",
hjust = 0,
gp = gpar(
col = "#9e00ff",
fontsize = 8,
family = "roboto",
fontface = "bold",
lineheight = 0.8)),
xmin = as.POSIXct("2025-04-29 01:30", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 01:30", tz = "Europe/Madrid"),
ymin = 22500,
ymax = 22500
) +
# solar termica text
annotation_custom(
grob = textGrob(
"Solar \ntérmica",
hjust = 0,
gp = gpar(
col = "#ff0400",
fontsize = 8,
family = "roboto",
fontface = "bold",
lineheight = 0.8)),
xmin = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
ymin = 19000,
ymax = 19000
) +
# solar fotovoltaica text
annotation_custom(
grob = textGrob(
"Solar \nfotovoltaica",
hjust = 0,
gp = gpar(
col = "#e58401",
fontsize = 8,
family = "roboto",
fontface = "bold",
lineheight = 0.8)),
xmin = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
ymin = 16000,
ymax = 16000
) +
# eólica text
annotation_custom(
grob = textGrob(
"Eólica",
hjust = 0,
gp = gpar(
col = "#70b026",
fontsize = 8,
family = "roboto",
fontface = "bold",
lineheight = 0.8)),
xmin = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
ymin = 13500,
ymax = 13500
) +
# hidráulica text
annotation_custom(
grob = textGrob(
"Hidráulica",
hjust = 0,
gp = gpar(
col = "#018fd1",
fontsize = 8,
family = "roboto",
fontface = "bold",
lineheight = 0.8)),
xmin = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
ymin = 10500,
ymax = 10500
) +
# cogeneracion y residuos text
annotation_custom(
grob = textGrob(
"Cogeneración \ny residuos",
hjust = 0,
gp = gpar(
col = "#d6a1d7",
fontsize = 8,
family = "roboto",
fontface = "bold",
lineheight = 0.8)),
xmin = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
ymin = 8000,
ymax = 8000
) +
# Ciclo combinado text
annotation_custom(
grob = textGrob(
"Ciclo \ncombinado",
hjust = 0,
gp = gpar(
col = "#ab9559",
fontsize = 8,
family = "roboto",
fontface = "bold",
lineheight = 0.8)),
xmin = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:30", tz = "Europe/Madrid"),
ymin = 0,
ymax = 0
) +
# caption text
annotation_custom(
grob = textGrob(
"Fuente: Red Elétrica - EpData 2025",
hjust = 1,
gp = gpar(
col = "#b8b8b8",
fontsize = 8,
family = "roboto",
lineheight = 0.8)),
xmin = as.POSIXct("2025-04-29 06:30", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 06:30", tz = "Europe/Madrid"),
ymin = -21500,
ymax = -21500
) +
# caption line
annotation_custom(
grob = linesGrob(
x = unit(c(0,1), "npc"),
y = unit(c(0.5,0.5), "npc"),
gp = gpar(col = "#e2e2e2", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-27 20:00", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 06:30", tz = "Europe/Madrid"),
ymin = -20000,
ymax = -20000
) +
# title line
annotation_custom(
grob = linesGrob(
x = unit(c(0,1), "npc"),
y = unit(c(0.5,0.5), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-27 19:45", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 06:30", tz = "Europe/Madrid"),
ymin = 42500,
ymax = 42500
) +
# consumo bombeo line
annotation_custom(
grob = linesGrob(
x = unit(c(1,0), "npc"),
y = unit(c(0,1), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-29 01:15", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 01:30", tz = "Europe/Madrid"),
ymin = -4000,
ymax = -200
) +
# ciclo combinado line
annotation_custom(
grob = linesGrob(
x = unit(c(1,0), "npc"),
y = unit(c(0,1), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-29 00:45", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:15", tz = "Europe/Madrid"),
ymin = 4000,
ymax = 700
) +
# cogeneracion y residuos line
annotation_custom(
grob = linesGrob(
x = unit(c(1,0), "npc"),
y = unit(c(0,1), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-29 00:45", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:15", tz = "Europe/Madrid"),
ymin = 9900,
ymax = 8900
) +
# hidraulica line
annotation_custom(
grob = linesGrob(
x = unit(c(1,0), "npc"),
y = unit(c(0,1), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-29 00:45", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:15", tz = "Europe/Madrid"),
ymin = 13000,
ymax = 10500
) +
# eolica line
annotation_custom(
grob = linesGrob(
x = unit(c(1,0), "npc"),
y = unit(c(0,1), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-29 00:35", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:15", tz = "Europe/Madrid"),
ymin = 16500,
ymax = 13500
) +
# solar fotovoltaica line
annotation_custom(
grob = linesGrob(
x = unit(c(1,0), "npc"),
y = unit(c(0,1), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-29 01:00", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:15", tz = "Europe/Madrid"),
ymin = 16500,
ymax = 16000
) +
# solar termica line
annotation_custom(
grob = linesGrob(
x = unit(c(1,0), "npc"),
y = unit(c(1,0), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-29 01:00", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:15", tz = "Europe/Madrid"),
ymin = 16500,
ymax = 19000
) +
# solar termica renovable
annotation_custom(
grob = linesGrob(
x = unit(c(1,0), "npc"),
y = unit(c(1,0), "npc"),
gp = gpar(col = "#000000", lwd = 0.5)
),
xmin = as.POSIXct("2025-04-29 00:45", tz = "Europe/Madrid"),
xmax = as.POSIXct("2025-04-29 02:15", tz = "Europe/Madrid"),
ymin = 16500,
ymax = 21000
)
final