[R] subplot (Hmisc) and radial.plot (plotrix) problem

Jim Lemon jim at bitwrit.com.au
Sat Feb 16 12:11:19 CET 2013


On 02/16/2013 05:30 PM, Andrew Roberts wrote:
> Folks,
>
> I am having problems with a plot I want to create to give an impression
> of changes in an ordinal scale measure (1-5) at three time points (0, 14
> and 21 days). I can produce a radial plot of bare vectors but getting
> this to appear on the base plot is not possible as it always seems to
> end up below the plot area and even outside the plot window.
>
> It seems I have not understood something about the coordinate system, Is
> anyone able to shed any light on this?
>
Hi Andrew,
I'm not quite sure, but the radial plot function may be working as I 
changed the ylim in the initial call to plot to:

ylim=c(-5,5),

added the lines:

   print(ang)
   print(freq)

to the loop in your code. What is printed is:

[1] -0.0715503  0.0000000
[1] 1 1
       ang
0.0715503
freq
    3
[1] -0.0715503  0.0715503  0.1438370
[1] 1 2 1
[1] 0.0715503 0.1438370
[1] 1 3
[1] 0.0715503 0.1438370
[1] 1 1

and this does look like what is being displayed. Five of the lines are 
in much the same place and are overplotted and there are five 
"centroids" displayed. I'm not completely familiar with the "subplot" 
function, so I'll let Greg comment on that. Clearly the successive 
radial plots are not being offset as expected.

Jim



More information about the R-help mailing list