Adding Title to pedigree plot

Hi everyone! I am creating pedigree plot for families to confirm the relationship and I'm using package kinship2. I'm trying to create the plots and everything is fine with the way they look. I just can't add the title in a proper way and I don't know why.
This command creates the plot and adds the title but is right aligned to the plot and gives me the following error. I also tried with just main = "EPBL0001", but doesn't add the title at all.

> plot(ped1, title(main="EPBL0001"),cex = 0.8, mar = c(18, 18, 3, 18))
Error in plot.pedigree(ped1, title(main = "EPBL0001"), cex = 0.8, mar = c(18,  : 
  Wrong length for id

This is a shortcoming in the {kinship2} plot implementation. I can reproduce the error message with either title(main = "The Title") or title(sub = 'The Subtitle") using either plot or legendPlot. Under RStudio, it produces the text, even though it throws the error.

1 Like

Ok got it, thank you. But now I've got a title right-aligned to the plot. How do I center it?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.