2
In the annotations inserted by the argument annotate
in the chart below in one of them has the symbol " ", but when saving the image as PDF the symbol disappears and appears "..." instead.
I’d like to keep it even after saving, is there any way?
Follow the command used and an image illustrating the example.
library(ggplot2)
dt <- data.frame(periodo = c("JUN", "JUL"),
peso = c(9.38, 26.14,16.27,47.71))
dt$Variedade <- rep(c("6654", "9002"), each = nrow(dt)/2)
dt$periodo <- factor(dt$periodo, levels = c("JUN", "JUL"))
theme_patrick <- function(){
theme(axis.title.y=element_blank(),
axis.text.y=element_blank(),
axis.ticks.y=element_blank(),
axis.text.x=element_text(face = "bold", color = "black", size = 15),
legend.text = element_text(size = 15),
plot.subtitle = element_text(size = 12, face = "bold", hjust = 0, vjust = 2))}
ggplot(dt, aes(x = periodo, y = peso)) +
geom_col(aes(fill = Variedade), position = "dodge") +
geom_label(aes(label = peso, colour = Variedade),
fill = NA,
position = position_dodge(width = 1),
size = 5,
fontface = "bold", vjust = -0.1,
show.legend = FALSE) +
labs(x = "Período", y = "", title = "", subtitle = "Evolução peso")+
scale_y_continuous(limits = c(0,80))+
scale_fill_manual(values = c("brown1", "blue")) +
scale_colour_manual(values = c("brown1", "blue")) +
theme_patrick()+
annotate(geom = "label", x = c("JUN","JUL"), y = c(20,40), label = c("≠6.89 kg","≠21.57
kg"), fontface = "bold", size = 5)+
annotate(geom = "label", x = c(1.89,2.39), y = c(28.3,50), label = c("+16.76 kg","+31.44
kg"), colour = c("brown1","blue"), fontface = "italic", size = 5)
It is obvious that the font used to display on the screen is different from the one used in the PDF, and the second source does not have this symbol. I suggest choosing a specific source, then it will appear in both media, or in no.
– epx
@epx the font format that speaks is the font type ?
– patrick cesar