2
Hello, I have the following problem: when I print the chart in Rmarkdown it gets the numbers one over the other, in addition to indicating the month/year in the coordinates also get the wrong view..
Is there any code to increase the chart size so it doesn’t happen? Or some idea to improve?
ggplot(data = planilha.grafico, aes(x = Ano, y = value, color = type)) +
geom_line(size=1.0) + scale_x_date(date_breaks = "1 month", date_labels
= "%b/%Y") +
labs(title = "Gráfico 8: Evolução do Reajuste de Inativos",
subtitle = "Fonte: Base de Dados SIGRH", x = " ", y = "Quantidade") +
theme(axis.line.x = element_line(size = .5, colour = "black"),
axis.line.y = element_line(size = .5, colour = "black"),
axis.text.x = element_text(colour = "black", size = 8),
axis.text.y = element_text(colour = "black", size = 8),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
legend.position = "bottom", legend.direction = "horizontal",
legend.title = element_blank()) +
geom_point(size=1.5) +scale_y_continuous(limits = c(0, 160000)) +
geom_text(data = planilha.grafico, aes(x=Ano, y=value, label = value,
vjust = -1.1), size=3)
dput of the data used to create the chart
## structure(list(Ano = structure(c(16801, 16832, 16861, 16892,
## 16922, 16953, 16983, 17014, 17045, 17075, 17106, 17136, 17167,
## 16801, 16832, 16861, 16892, 16922, 16953, 16983, 17014, 17045,
## 17075, 17106, 17136, 17167), class = "Date"), type = c("Paridade",
## "Paridade", "Paridade", "Paridade", "Paridade", "Paridade", "Paridade",
## "Paridade", "Paridade", "Paridade", "Paridade", "Paridade", "Paridade",
## "Média", "Média", "Média", "Média", "Média", "Média", "Média",
## "Média", "Média", "Média", "Média", "Média", "Média"), value = c(149160,
## 149300, 149599, 149787, 150039, 150319, 150507, 150584, 151025,
## 151380, 151429, 151952, 151827, 4227, 4231, 4229, 4240, 4251,
## 4258, 4377, 4404, 4427, 4471, 4502, 4554, 4581)), row.names = c(NA,
## -26L), .Names = c("Ano", "type", "value"), class = c("tbl_df",
## "tbl", "data.frame"))
It would be possible to edit the question to put the result of the command
dput(planilha.grafico)
? Then we’d have your dataset to work on and try to solve your problem.– Marcus Nunes