Skip to content
Prev 14161 / 15379 Next

[R-es] Leyenda gráfico combinado

Hola,

Tal vez tu problema esté en el rango del eje X. No puedo comprobarlo porque tu código no es reproducible, pero lo siguiente funciona:

ggplot(data.frame(x=101:200, y = rnorm(10, 100)), 
       aes(x, y)) + geom_bar(stat="identity") +  
  annotate(geom = 'text',x = 0,
           y = 750,
           hjust = 0,
           label = "Biomasa=220,774(IAF)+39,759(Aprom)-163,883")+
  annotate(geom = 'text',
           x = 0,
           y = 700,
           hjust = 0,
           label = "R² = 0,982      P=3,8187E-17")

Si x=individuo, entonces el annotate puede quedar fuera del rango (aunque debería ajustarse automáticamente como en el código que pego)

Con un ejemplo reproducible será más fácil ayudarte, bastará con una muestra de los datos (fácil con dput, mira aquí):
https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example <https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example>

Un saludo,
Emilio