1

I want to make a graphic made with ggarrange, use shared labels for the axis and export it with cairo to have a nice image. The problem is that when I add it to latex the graphic is surrounded by a line which crosses the axis labels. How can I remove that line from the graphic?

6 plots (m1_g to m6_g) are combined with ggarrange to make a graphic called figure, then its annotated with annotate_figure to produce the graphic called figure2.

figure = ggarrange(m2_g+rremove("ylab")+rremove("xlab"),m1_g + rremove("ylab")+rremove("xlab"),m3_g  +rremove("xlab")+ rremove("ylab"),m4_g +rremove("xlab") + rremove("ylab"),
          m5_g  +rremove("xlab")+ rremove("ylab"),m6_g  +rremove("xlab")+ rremove("ylab"),
          common.legend = TRUE, legend="right",ncol = 6)

figure2 = annotate_figure(figure, left = textGrob("Voltaje [mV]", rot = 90, vjust = 1, gp = gpar(cex = 1.3)),bottom = textGrob("Tiempo E-1 [s]", gp = gpar(cex = 1.3)))

ggsave("measurements_P4.png",plot = figure2, width = 10,type = "cairo")
` 

This is the problem i am facing

  • Welcome to SO! It would be easier to help you if you provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a working code example and some data if needed. However, for your issue we probably don't need your real code and plots, e.g. a simple plot based on `iris` or `mtcars` should be sufficient. Also it's not necessary to have six plots. Just two should be sufficient. And as issues with graphics devices may depend on the platform it would be helpful to include that info as well. – stefan Oct 26 '22 at 16:53

0 Answers0