I would like to add characters to R plots but need separate control over height, width, skew, rotation etc. These parameters result from a statistical computation within R. Also I need to be able to control stroke and fill parameters independently. Finally, I need more than just ASCII characters, but symbols and possibly Chinese/Japanese. What I've found so far points to a solution where I send the character and scale information to an external script that produces what I need in Postscript, then import via the grImport package. I assume there is a more direct way via editing R sources, such as inserting a transformation into text(), but that's probably not a good idea in the long run. Or is there a better strategy? [[alternative HTML version deleted]]
Hi R's text-drawing functions, such as text() or grid.text(), do NOT allow you to skew or stretch individual characters (like PostScript does). Your strategy of using PostScript to produce a result and then import the result as a "shape" for R to draw may work (if you can script it). Paul On 11/03/13 14:46, Iakub Henschen wrote:> I would like to add characters to R plots but need separate control over > height, width, skew, rotation etc. These parameters result from a > statistical computation within R. Also I need to be able to control stroke > and fill parameters independently. Finally, I need more than just ASCII > characters, but symbols and possibly Chinese/Japanese. What I've found so > far points to a solution where I send the character and scale information > to an external script that produces what I need in Postscript, then import > via the grImport package. I assume there is a more direct way via editing R > sources, such as inserting a transformation into text(), but that's > probably not a good idea in the long run. Or is there a better strategy? > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/
Hi Iakub,Do you mind sharing a concrete example of your approach (from R to your script and back to R)? There is a growing demand to produce R plots for government reports that ideally wouldn't require the intervention of a designer to control the typography. While I'm getting a good grip at producing nice looking plots that follow the designer's style sheet, the poor control of typography in R is the last frontier I'm facing...I tried using tikzDevice, but that failed for complicated plots. E.g. maps with road networks from a shapefile become enormous tikz files, causing the LaTeX compilation to fail. A promising approach was to convert R plots exported as svg, usinginkscape -D -z --file=image.svg --export-pdf=image.pdf --export-latex. This separates the text from the graphical elements, allowing the text style and typography to be controlled by Latex. However, the text properties don't seem to be exported (vjust, hjust, etc.).That's unfortunate. While R graphical capabilities are sufficient for scientific publications (not caring too much for the look), full reproducibility is still impossible for higher style requirements as a designer is always required to change things manually. But maybe your approach is the way to go? -- View this message in context: http://r.789695.n4.nabble.com/Control-over-character-height-width-skew-etc-tp4679630p4684591.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]