<p dir="auto">Annotations using a bbox boxstyle of "round" have different (incorrect?) clipping behavior compared to a square boxstyle.</p>
<p dir="auto">As an example, note that with matplotlib 1.4.0, the connector arrow extends inside the round box, while it is clipped for the square boxstyle.  With earlier versions, both have the same clipping behavior.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
import matplotlib

def main():
    fig, ax = plt.subplots()
    ax.set(title='Matplotlib {}'.format(matplotlib.__version__))
    annotate(ax, 'Round')
    annotate(ax, 'Square')
    plt.show()

def annotate(ax, text):
    bbox = dict(fc='none')
    x, y = 0.1, 0.1

    if text == 'Round':
        bbox['boxstyle'] = 'round'
        y = 0.5

    ax.annotate(text, xy=(x, y), xytext=(50, 50), size=20,
                xycoords='data', textcoords='offset points',
                bbox=bbox,  arrowprops=dict(arrowstyle='-&gt;'))

main()"><pre class="notranslate"><code class="notranslate">import matplotlib.pyplot as plt
import matplotlib

def main():
    fig, ax = plt.subplots()
    ax.set(title='Matplotlib {}'.format(matplotlib.__version__))
    annotate(ax, 'Round')
    annotate(ax, 'Square')
    plt.show()

def annotate(ax, text):
    bbox = dict(fc='none')
    x, y = 0.1, 0.1

    if text == 'Round':
        bbox['boxstyle'] = 'round'
        y = 0.5

    ax.annotate(text, xy=(x, y), xytext=(50, 50), size=20,
                xycoords='data', textcoords='offset points',
                bbox=bbox,  arrowprops=dict(arrowstyle='-&gt;'))

main()
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/906803/6315056/18b7660a-b9bb-11e4-9f99-3736628f8f02.png"><img src="https://cloud.githubusercontent.com/assets/906803/6315056/18b7660a-b9bb-11e4-9f99-3736628f8f02.png" alt="clip_mpl1 3" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/906803/6315057/211d3d06-b9bb-11e4-9265-fd14e15f11e9.png"><img src="https://cloud.githubusercontent.com/assets/906803/6315057/211d3d06-b9bb-11e4-9265-fd14e15f11e9.png" alt="clip_mpl1 4 0" style="max-width: 100%;"></a></p>
<p dir="auto">The problem persists up to and including the current HEAD, but newer versions also have the issue described in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="58465861" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/4139" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/4139/hovercard" href="https://github.com/matplotlib/matplotlib/issues/4139">#4139</a>  The two issues don't appear to be directly related.</p>
<p dir="auto"><del>Sorry, here's another one without a simplified test case. I will try and get to that tomorrow. For this, you will need matplotlib 1.4.2 and the development version of <a href="https://github.com/obspy/obspy">ObsPy</a>. Then run <code class="notranslate">obspy3-runtests -d obspy.station.tests.test_station.StationTest.test_response_plot</code>.</del> Test case is below.</p>
<p dir="auto">With mpl 1.3.1, the plot is as so:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/302469/5798822/65e23d88-9f99-11e4-9a24-874f3eee5285.png"><img src="https://cloud.githubusercontent.com/assets/302469/5798822/65e23d88-9f99-11e4-9a24-874f3eee5285.png" alt="station_response" style="max-width: 100%;"></a></p>
<p dir="auto">With mpl 1.4.2 (and master), the plot is as so:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/302469/5798827/77bac822-9f99-11e4-9848-b359a5693c6e.png"><img src="https://cloud.githubusercontent.com/assets/302469/5798827/77bac822-9f99-11e4-9848-b359a5693c6e.png" alt="station_response" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/302469/5798832/7feab8fe-9f99-11e4-9aa1-8b5a01ee8727.png"><img src="https://cloud.githubusercontent.com/assets/302469/5798832/7feab8fe-9f99-11e4-9aa1-8b5a01ee8727.png" alt="station_response-failed-diff" style="max-width: 100%;"></a></p>
<p dir="auto">You can see that the arrows are thinner and shifted a bit.</p>
<p dir="auto">I believe the relevant bit of code is the following, but I will try to simplify it later:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="            trans_above = blended_transform_factory(ax1.transData,
                                                    ax1.transAxes)
            trans_right = blended_transform_factory(ax1.transAxes,
                                                    ax1.transData)
            arrowprops = dict(
                arrowstyle=&quot;wedge,tail_width=1.4,shrink_factor=0.8&quot;, fc=color)
            bbox = dict(boxstyle=&quot;round&quot;, fc=&quot;w&quot;)
            ax1.annotate(&quot;%.1g&quot; % self.instrument_sensitivity.frequency,
                         (self.instrument_sensitivity.frequency, 1.0),
                         xytext=(self.instrument_sensitivity.frequency, 1.1),
                         xycoords=trans_above, textcoords=trans_above,
                         ha=&quot;center&quot;, va=&quot;bottom&quot;,
                         arrowprops=arrowprops, bbox=bbox)
            ax1.annotate(&quot;%.1e&quot; % self.instrument_sensitivity.value,
                         (1.0, self.instrument_sensitivity.value),
                         xytext=(1.05, self.instrument_sensitivity.value),
                         xycoords=trans_right, textcoords=trans_right,
                         ha=&quot;left&quot;, va=&quot;center&quot;,
                         arrowprops=arrowprops, bbox=bbox)"><pre class="notranslate"><code class="notranslate">            trans_above = blended_transform_factory(ax1.transData,
                                                    ax1.transAxes)
            trans_right = blended_transform_factory(ax1.transAxes,
                                                    ax1.transData)
            arrowprops = dict(
                arrowstyle="wedge,tail_width=1.4,shrink_factor=0.8", fc=color)
            bbox = dict(boxstyle="round", fc="w")
            ax1.annotate("%.1g" % self.instrument_sensitivity.frequency,
                         (self.instrument_sensitivity.frequency, 1.0),
                         xytext=(self.instrument_sensitivity.frequency, 1.1),
                         xycoords=trans_above, textcoords=trans_above,
                         ha="center", va="bottom",
                         arrowprops=arrowprops, bbox=bbox)
            ax1.annotate("%.1e" % self.instrument_sensitivity.value,
                         (1.0, self.instrument_sensitivity.value),
                         xytext=(1.05, self.instrument_sensitivity.value),
                         xycoords=trans_right, textcoords=trans_right,
                         ha="left", va="center",
                         arrowprops=arrowprops, bbox=bbox)
</code></pre></div>
<p dir="auto">I did a bisect and the bad commit was:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="3363b125715724ad89d4b33cbddb23e31e7277d5 is the first bad commit
commit 3363b125715724ad89d4b33cbddb23e31e7277d5
Author: Thomas A Caswell &lt;tcaswell@gmail.com&gt;
Date:   Tue Aug 27 17:07:58 2013 -0500

    re factored `_AnnoationBase` to push keeping track of there the
    secondary object is to the sub-classes.

    Added properties to maintain back-compatibility

    added properties to replace xytext and textcoords (xyann, anncoords)

    properly deprecated `textcoord` and `xytext` in favor of `anncoords`
    and `xyann`.

:040000 040000 f17d8e1a70232471435f96b1faa8550bc697ec32 567d4a0a86bb3d1fb7ec55dc0fa98e86c1dec71a M  doc
:040000 040000 34339e9d0d9f49477908fc3c3227b1b7b55735b4 4dc225e1358d422aa86f9361672c36e127955bee M  lib"><pre class="notranslate"><code class="notranslate">3363b125715724ad89d4b33cbddb23e31e7277d5 is the first bad commit
commit 3363b125715724ad89d4b33cbddb23e31e7277d5
Author: Thomas A Caswell &lt;tcaswell@gmail.com&gt;
Date:   Tue Aug 27 17:07:58 2013 -0500

    re factored `_AnnoationBase` to push keeping track of there the
    secondary object is to the sub-classes.

    Added properties to maintain back-compatibility

    added properties to replace xytext and textcoords (xyann, anncoords)

    properly deprecated `textcoord` and `xytext` in favor of `anncoords`
    and `xyann`.

:040000 040000 f17d8e1a70232471435f96b1faa8550bc697ec32 567d4a0a86bb3d1fb7ec55dc0fa98e86c1dec71a M  doc
:040000 040000 34339e9d0d9f49477908fc3c3227b1b7b55735b4 4dc225e1358d422aa86f9361672c36e127955bee M  lib
</code></pre></div>