How do I put a circle with annotation in matplotlib?
<p>I plot a graph created by networkx with matplotlib. Now, I'd like to add annotation to a specific node with a circle around. For instance,</p>

<p><a href="https://i.stack.imgur.com/mJaRq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mJaRq.png" alt="enter image description here"></a></p>

<p>I use <a href="http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.annotate" rel="noreferrer"><code>plt.annotate(*args, **kwargs)</code></a> with the following code,</p>

<pre><code># add annotate text
pos = nx.get_node_attributes(G, 'pos')
pos_annotation_node = pos['Medici']
ax2.annotate('Midici', 
            xy=pos_annotation_node, 
            xytext=(i+0.2 for i in pos_annotation_node),
            color='blue',
            arrowprops=dict(facecolor='blue', shrink=0.01)
        )
</code></pre>

<p>And I got this ugly graph,</p>

<p><a href="https://i.stack.imgur.com/KXfZd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KXfZd.png" alt="enter image description here"></a></p>

<p>I have two questions:</p>

<ul>
<li>how do I draw a circle around the node <code>6</code> as shown in first figure.</li>
<li>to get a nice looking figure, I need manually set the value of <code>xytext</code> many times. Is there a better way?</li>
</ul>