Build a graph containing the NA

Hello everyone
Need help please
After running the scripts, I got a graph that doesn't match my expectation. By the way, in this graph, the evolution of data from the R region has stopped due to the lack of data for the month of April (which is normal for me), however the evolution curve should normally continue after the break, because the data for the month of May for this region are present in the file. I would like to have a continuity of the evolution of the curve of the R region after a break in April.
In addition, As the data for the month of June are not present in the data
a file, I would like this label not to appear. Is it possible to remove the label "06 -2022" on the abscissa axis?
data file:


Graph :
Scripts used to produce the graph:
graph_data <- read.xlsx("./inputs/data_region3.xlsx")

graph_data <- mutate(graph_data, mois = as.Date(mois, format = "%d %m %Y"))

ggplot(graph_data, aes(x=mois, y=pma, group=Région)) +
theme_ipsum()+
geom_line(aes(linetype=Région, color=Région, size=Région))+
scale_color_brewer(palette="Set2")+
scale_linetype_manual(values=c("solid", "dashed", "solid", "solid", "dashed", "solid"))+
scale_size_manual(values=c(1, 1, 1, 1, 1, 1))+
labs(x = "",
y = "Cost")+
theme(axis.title.y = element_text(size = 15, hjust = 0.5, vjust = 4, face = "bold"))+
theme(axis.text.y = element_text(size = 12))+
theme(axis.text.x = element_text(size = 12))+
theme(legend.key.width = unit(3.3, "line"))+
theme(panel.grid.major = element_line(size = 0.6))+
theme(panel.grid.minor = element_line(size = 0.6))+
theme(legend.text = element_text(size = 13))+
theme(legend.title = element_text(size = 14, face = "bold"))+
scale_x_date(date_labels = "%m - %Y", date_breaks = "1 month")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.