-1
I’m using the function annotate
to try to number a figure with facet_grid, but the number goes on the two axes y. How do I write on only one side?
https://1drv.ms/x/s! Avi1orbh4c0tjiyruc0ouxkny5fg? e=B6w23z
library(readxl)
Dados <- read_excel("Dados.xlsx")
print(Dados)
require(tidyverse)
require(ggthemes)
graph <- ggplot(Dados,aes(x = Temp, y = Gly, shape = Accesion)) +scale_shape_manual("Biotypes", values = c(19, 5))+
geom_point(stat = 'summary', fun.y = 'mean') +
geom_errorbar(stat = 'summary', fun.data = 'mean_se',
width=.08, fun.args = list(mult = 1.96)) +scale_y_continuous(breaks = seq(0, 125, 25), limits = c(0, 125))+
facet_grid( . ~ Year ) +annotate("text", x=0.5, y=125, label= "3") +
labs(x = 'Harvesting time', y = 'Glyphosate')+
theme_bw() +
theme(
axis.title = element_text(size = 10),
axis.text = element_text(size = 10),
text = element_text(family = 'Times'),
legend.position = "Right",
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()
)
graph
can create an MWE?
– Lucas
Hello Lucas, thank you for answering! I edited the question and inserted a figure to illustrate. I need to number the figure. However, with the annotate function the number goes in the two figures. I need the number 3 to be just on the left
– Diego Chiapinotto
we need a database to replicate your problem (the database you are using or an equivalent example). MWE is the English acronym for a minimum verifiable example. See instructions: https://answall.com/help/minimal-reproducible-example
– Lucas
I’m a beginner around here. I don’t know how to share the data, I took a print of them...
– Diego Chiapinotto
Can you please, edit the question with the departure of
dput(Gly_72_HORAS)
or, if the base is too large,dput(head(Gly_72_HORAS, 20))
?– Rui Barradas
I attached the data to the on drive
– Diego Chiapinotto
If one of the answers below solved your problem and there was no doubt left, choose the one you liked the most and mark it as correct/accepted by clicking on the " " that is next to it, which also marks your question as solved. If you still have any questions or would like further clarification, feel free to comment.
– Lucas