very wide graph legend frame

I want to know how to make the margin of the legend look smaller and more centered, thank you very much in advance, greetings.

     ylab = "Precipitation [mm]",xlab = "Days", col="black",lwd=1, ylim = range(0,max(PP_muxobs)*1)) 
for (k in 1:10){#lo cambie a 1:!
  matplot(1:365,PP_muxCont[,,k],type="l" , add = TRUE, col=("gray"), lwd=2)
  #matplot(1:365,PP_muxHist[,,k],type="l" , add = TRUE, col=("gray"),lwd=2)
matplot(1:365,PP_muxobs,type="l" , add = TRUE, col=("black"), lwd=1)
legend(x = "topright",         # Posición
       c( "Observed" , "GCM Simulated" ), # Textos de la leyenda
       inset = 0.05,
       lty = c(1, 1),          # Tipo de líneas
       col = c("black","gray46"),          # Colores de las líneas
       cex = 0.8, # Cambiar el tamaño
       lwd = 1,  # Ancho de las líneas
       adj=0.5) #texto centrado)```


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.