<div dir="ltr"><div><div><div>Hi Jan,<br><br></div>Could you show us some more information about your tree, like the first few lines you see with &quot;print tree&quot;? Also try converting the tree to a NetworkX graph, which is the intermediate form used by draw_graphviz, and inspecting the nodes to see if names were lost or retained:<br><br></div><div>graph = Phylo.to_networkx(tree)<br></div><div>graph.nodes()<br><br></div><div>Also:<br><br></div><div>- What was the source file format (e.g. Newick, Nexus, PhyloXML, NeXML)<br></div><div>- Which versions of Biopython and NetworkX are you using?<br></div><div><br></div>It&#39;s possible the node names are assigned to a different attribute than the node name, in which case you can use the &quot;label_func&quot; argument in draw_graphviz to retrieve the name from the graph node.<br><br></div>Hope that helps,<br>Eric<br><div><div><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 22, 2015 at 8:02 AM, Jan Zaucha <span dir="ltr">&lt;<a href="mailto:Jan.Zaucha@bristol.ac.uk" target="_blank">Jan.Zaucha@bristol.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:13px">Hi everyone,</span><div style="font-size:13px"><br></div><div style="font-size:13px">I&#39;m trying to visualize the trees I generate, but for some reason the plots do not display the node names. When I print the tree each node has an associated name (string format). Phylo.draw(tree) also works fine and plots a tree with the node names. </div><div style="font-size:13px"><br></div><div style="font-size:13px">I simply use:</div><div style="font-size:13px">Phylo.draw_graphviz(tree)<br></div><div style="font-size:13px">pylab.show()</div><div style="font-size:13px"><br></div><div style="font-size:13px">There is no error, I can&#39;t work out how to force the node names to be printed. </div><div style="font-size:13px"><br></div><div style="font-size:13px">Any ideas?</div><div style="font-size:13px"><br></div><div style="font-size:13px">Thanks,</div><div style="font-size:13px">Jan Zaucha</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div>Jan Zaucha</div><div>Bristol Centre for Complexity Sciences<br></div><div>Computational Genomics Group<br></div><div>University of Bristol</div></div></div>
</font></span></div>
<br>_______________________________________________<br>
Biopython mailing list  -  <a href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biopython" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biopython</a><br></blockquote></div><br></div>