[R] problems with Stackpoly, package Plotrix

Jim Lemon jim at bitwrit.com.au
Tue Sep 22 00:12:51 CEST 2009


On 09/21/2009 09:15 AM, Václav Varvařovský wrote:
> Dear all,
>
> I am fairly new to package Plotrix and I would like to ask you, if any of
> you could help me with following.
>
> a) I don't know how to set up border line width in the Stackpoly function
> (seems that lwd from par doesn't work, or at least not in the way I have
> written)
> b) I don't know, how to rotate the x axis labels (I used srt=45, but same
> problem as before).
> c) Could anyone clarify to me, what does e.g. col= par("col") stand for in
> the usage explanation? Does it somehow change the way I should call such
> parameter?
> d) the three dots in stackpoly usage are calling other parameters from plot,
> however if in plot there are the three dots calling parameters from par, am
> I able to call parameters from par directly in stackpoly?
>
>    
Hi Vaclav,
You have identified several missing bits in stackpoly. Let's take them 
one by one.

a) There is no way to specify border width at the moment. stackpoly is a 
fairly new function, and I usually program these with minimal options 
and let the users tell me what is missing. In the modified function 
below, there is a "lwd" argument that allows the user to specify this.

b) If you want to have angled tick labels, you will have to roll your 
own with text(). First set par(xpd=TRUE), then display the labels, then 
set par(xpd=FALSE). Unfortunately axis() doesn't obey the srt argument.

c) I can't find the reference to col=par("col") in the help page 
(stackpoly uses col=NA). par("col") returns the current drawing color 
(default is black) and would be unlikely to be useful as you would get 
one big black polygon. The default is to use rainbow() to specify the 
colors, or the user can pass one or more colors that will define the 
fill colors for the polygons.

d) I think so. If the ... arguments are after any arguments that plot() 
recognizes, I think they will be passed to par(), but I can't say for sure.

The modified stackpoly function will appear in plotrix 2.7-1.

Jim

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stackpoly.R
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090922/a91546f1/attachment-0001.pl>


More information about the R-help mailing list