sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
177 stars 81 forks source link

Plot retention time deviation in 'retcor' function #639

Closed JunYang2021 closed 1 year ago

JunYang2021 commented 1 year ago

Hello! I want to use retcor function with obiwarp method to correct retention time. With retcor function, there was a plot showing retention time deviation. However, I need to adjust the plot width to a very large value to display a complete legend (like the figure below). So what should I do to display a complete and appropriate plot? My code:

png("AlignmentPlot.png", width = 5, height =4, units = "in", res = 300)
group.setc<-retcor(group.set, method='obiwarp', plottype='deviation',
                     profStep=0.1)
dev.off()

ZhuParameter_obiwarp1

sneumann commented 1 year ago

Hi, I am afraid I am not a wizard here, but you could try to work with the margins: https://stackoverflow.com/questions/32543240/altering-the-margins-of-a-legend-in-r https://stackoverflow.com/questions/23628141/set-margins-to-cater-for-large-legend There might also be a way to reduce the font size in the graphics parameters : https://stackoverflow.com/questions/16905535/r-legend-trouble-how-to-change-the-text-size-in-legend https://stackoverflow.com/questions/23628141/set-margins-to-cater-for-large-legend Hope that'll help, yours, Steffen

JunYang2021 commented 1 year ago

@sneumann Thank you for your suggestion. Because the plot code was embedded in retcor function, I can't directly change the margins or font size. I found that plot in Rstudio and then export to pdf can solve this problem partly. The legend can be displayed in plots of R studio with an acceptable width.