[R] Labels on a pyramide

Orvalho Augusto orvaquim at gmail.com
Sun Feb 14 15:07:11 CET 2010


Pardon my ignorance here.

The Jim code works. But the problem the text comes over the plot.
Adjusting the laxlab and raxlab, to get more plot are, the text keeps
being cut.

And one more thing that might be added as a new functionality is an
option to show the value of the bar.

Thanks for your help

Caveman


On Sun, Feb 14, 2010 at 1:05 PM, Jim Lemon <jim at bitwrit.com.au> wrote:
> On 02/14/2010 01:27 AM, Orvalho Augusto wrote:
>>
>> I am using pyramid.plot() from the plotrix package.
>> ...
>> The problem is (1) I do not want plot agelabels on the center and (2)
>> I want plot different labels for each pair of the bars (one label for
>> masculine and the other feminine).
>>
>> The data represent the 10 most frequent cancer in a group of individuals.
>>
>
> Bueno troglodita,
> You have discovered a deficiency in pyramid.plot, and for that you get an
> answer to your question and brand new source code!
>
> source("pyramid.plot.R")
>
> after loading the plotrix package. Use it quickly, for it will be in the
> next version of plotrix and then everyone (todo el mundo, hombre!) will be
> using it.
>
> Jim
>
> # it must be wider than the default to accommodate the long labels
> x11(width=10)
> par(mar=pyramid.plot(dados$masfr,dados$femfr,
>  laxlab=c(0,10,20,30,40),raxlab=c(0,10,20,30,40),
>  main="Primeiras 10 cancros mais frequentes por sexo",
>  top.labels=c("Masculino", "Tipo de cancro", "Feminino"),
>  labels=dados[,c("maslab","femlab")],
>  xycol=rep("#8888ff",10),xxcol=rep("#ff88ff",10), gap=25))
>



-- 
OpenSource Software Consultant
CENFOSS (www.cenfoss.co.mz)
SP Tech (www.sptech.co.mz)
email: orvaquim at cenfoss.co.mz
cell: +258828810980



More information about the R-help mailing list