Benjamin Tyner
2012-Sep-06 16:00 UTC
[R] draw.key; getting grobWidth to respect fontfamily="mono"
Hello Within my panel function, I am using draw.key to create a custom key for each panel. I'm trying to use grobWidth to calculate the correct width for the viewport, but it appears to be disregarding the fontfamily when computing the width. Attached is an example; any ideas what I'm doing wrong? Many thanks Ben -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: grobWidth.R URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120906/cfe0d2f8/attachment-0001.pl>
Benjamin Tyner
2012-Sep-06 21:35 UTC
[R] draw.key; getting grobWidth to respect fontfamily="mono"
Update: seems one way to skin this cat is to add gp = gpar(fontfamily="mono") to the viewport() call itself. If anyone has any suggestions for a robust way to extract this piece information from the key grob itself (it's nested several levels deep), I'm all ears. Thanks Ben