[R] Rotating the axis labels in the basic graphic device ?
Uwe Ligges
ligges at statistik.tu-dortmund.de
Sat Jan 23 17:52:33 CET 2010
On 23.01.2010 17:42, Marc Schwartz wrote:
> On Jan 23, 2010, at 10:25 AM, Tal Galili wrote:
>
>> Marc,
>> Following the R FAQ you linked to, I wonder how to ALWAYS have the text and the plot region fit.
>> I know that if the text is too long, one can use the par(mar = c(big.number, 4, 4 ,4)) and get the text to fit.
>> The question is:
>> Is there a way to make the plot "know" what "big.number" should be so the text wouldn't go beyond plot regions ?
>>
>> (I suspect my question might get lost inside this topic, if so - I'll repeat it with a different header)
>>
>> Thanks again,
>> Tal
>>
>
> <snip>
>
>
> Tal,
>
> I suspect that you would to create an algorithm using functions such as strwidth() and strheight() to get the plot metrics for the sizes of the character labels to have a sense of how much room would be required given other parameters.
>
> I am guessing that if you were to look at the appropriate source code in the lattice package, something along these lines is implemented there, since lattice supports rotated labels 'out of the box' and would logically have to consider these plotting characteristics at some level.
Well, lattice relies on grid and grid can place arbitrary viewports with
arbitrary rotations everywhere by design.
> Otherwise, it is a manual tweaking process.
Indeed, that's the thing I meant with "not by design". ;-)
Best wishes,
Uwe
> HTH,
>
> Marc
>
More information about the R-help
mailing list