Re: [R] Adjust cex to fit width

2013-05-06 Thread Prof Brian Ripley
This does depend on the unstated device. But on most devices the string width is either exactly or approximately proportional to cex. Some devices cannot scale fonts so there is a small set of available sizes: in which case you can use uniroot() to find the cex corresponding to the closest f

[R] Adjust cex to fit width

2013-05-06 Thread Dario Beraldi
Hello, I need to add some text to a plot and I would like this text to be of a given width in user coordinates. I know I can get the width of a string for a given cex using strwidth. But how can I do the other way around? How can I get the cex value that will make my string of a given width (at l