Skip to content

Setting annotation background covers arrow #4400

Closed

Description

@ndevenish

Setting a background on the annotation covers the arrow also. This didn't happen in 1.4.2. I've been using it to separate the text from any plot data points in cases where they overlap. Resolvable for now by redrawing an empty annotation with an arrow.

Pre 1.4.2:
screen shot 2015-05-03 at 15 06 58
Current:
screen shot 2015-05-03 at 15 03 21
Example code:

import matplotlib.pyplot as plt
import numpy
a = numpy.zeros(100)
a[::2] = 1
plt.figure(figsize=(5.9,4.4))
plt.plot(a)
shared_args = {"xytext":(-15,0), "va":'center', "ha":"right", "textcoords":'offset points', "arrowprops":{"arrowstyle": "->"}}
plt.annotate("Test", xy=(20,0.5), **shared_args)
plt.annotate("Test", xy=(20,0.4), backgroundcolor="w", **shared_args)
plt.show()

And the actual introducing commit, in the middle of what appears to be other restructuring 9d1c876

Activity

  1. tacaswell commented on May 3, 2015

    @tacaswell
    Member

    Suspect that this is related to #4139 #4140 and #4178.

    @efiring took a look at these issues and I have been avoiding looking into these issues as this code is more than a bit hairy.

  2. added this to the milestone on May 3, 2015
  3. ndevenish commented on May 3, 2015

    @ndevenish
    ContributorAuthor

    Hmm, yes it is very closely related to #4139 - the root cause is the same, but with an extra ordering issue in this one.

  4. modified the milestones: , on Oct 26, 2015
  5. tacaswell commented on Mar 21, 2016

    @tacaswell
    Member

    so

    This appears to be fixed, have not done forensics to sort out by what.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions