Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kinship2 plot.pedigree question #4

Open
zihhuafang opened this issue Apr 19, 2021 · 1 comment
Open

Kinship2 plot.pedigree question #4

zihhuafang opened this issue Apr 19, 2021 · 1 comment

Comments

@zihhuafang
Copy link

zihhuafang commented Apr 19, 2021

Hi @sinnweja,

Thank you for developing kinship2 package. I found it extremely useful for plotting pedigrees, and it's a time saver!

I plotted my pedigree (see attached file) but would like to modify certain plotting parameters.
I am wondering if you could advise me how to tailor plot.pedigree as I did not fully understand autohints function.

Which parameter can be used to align a spouse without children to the same level of the other one of the couple?
I ran autohint not sure what to change here.

autohint(ped2, hints, packed=F, align=T)
$order
 [1]  1  2  3  4  5  6  7  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27  1  2
[37]  1  4  2  3  7  4  9  5 11  6  7 14  8 16 17  9 10 11 21 12 13 14 25  1  2  3  4  1  2  3  4

$spouse
     [,1] [,2] [,3]
temp   35   36    0

Which parameter can be used to provide the coordinate of the legend placement? Is it possible other than "location"?

Appreciate your input!!
Best wishes,
Zih-Hua

Rplot02.pdf

@sinnweja
Copy link
Member

sinnweja commented Feb 1, 2022

Zih-Hua, the function pedigree.legend is limited to the "x" argument of the regular legend function, e.g., "topright", "bottomleft". I understand the frustration, which is why I tried to work up a better legend with the legendPlot() function.

`
data(sample.ped)
pedAll <- pedigree(sample.ped$id, sample.ped$father, sample.ped$mother,
sample.ped$sex, affected=cbind(affected=sample.ped$affected, avail=sample.ped$avail),
famid=sample.ped$ped)

ped2 <- pedAll['2']
plot(ped2)

##add single-circle legend to top right with default size(radius)
pedigree.legend(ped2, location="topright")

this might be more clean

legendPlot(ped2)
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants