xavierdidelot / TransPhylo

Reconstruction of transmission trees using genomic data
http://xavierdidelot.github.io/TransPhylo/
GNU General Public License v2.0
60 stars 22 forks source link

Manipulating/edit plots #28

Closed am-epi closed 1 year ago

am-epi commented 1 year ago

Hi Xavier,

Is there a way to manipulate or edit plots created by Transphylo? For example this consTTree (link below), the scale bar is presumably just plotting for the dates I have sampled but the transmission tree clearly goes back beyond the sampled sequences. Secondly my tip labels are overlapping or cut off - this I can adjust by exporting as an svg and changing manually in Inkscape but is time consuming if there's a quicker way to do so in R. The one I'd most like to be done in R is the time scale bar to make sure that's accurate. Any help would be appreciated, is it a case of using ggplot (or similar) or can something be done within the Transphylo package?

Best wishes, Abbi

(https://user-images.githubusercontent.com/108280328/226549891-e1dd79eb-170c-4668-9aec-df855b3deab1.png)

xavierdidelot commented 1 year ago

Hi Abbi,

The function you used for this figure is plotTTree2 (even if you might have just called plot) See options here: http://xavierdidelot.github.io/TransPhylo/reference/plotTTree2.html You can change the labels by modifying ttree$nam if ttree is the transmission tree you are plotting. You can change the scale bar using the maxTime argument or you could add another scale bar using axis(1,...)

Best wishes, Xavier

am-epi commented 1 year ago

Thanks for the clarification and quick response!