grimport

538-ify ggplot output: justifying pictureGrob in R grid graphics

烈酒焚心 提交于 2019-12-19 11:43:22
问题 I am trying to write a little utility function that will annotate my plots Reuben Fischer-Baum style with a nice little logo and url at the bottom - eg: I've figured out how to get a postscript file loaded into R; it's justifying the image on the bottom of the plot that's driving me crazy. I can't get the pictureGrob to left justify; at best I can get it to center on the left hand side of my plot, but half of my image gets cut off, like this reproducible example below: Tinkering with the

Difference between ggplot and grid.picture with complex shapes

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:13:56
问题 I wish to obtain the x/y coordinates of individual letters and plot them with ggplot. I am using grImport::PostScriptTrace to obtain an XML file from a Postscript file. From there I extract x, y coordinates from the S4 object of class Picture. Plotting the letter with grid.picture works well: Using my method to obtain x, y coordinates and using ggplot doesn't work well: Removing the last row of the dataframe helps a little: The XML file for the letter "g" is on Dropbox. How can I use ggplot