8000 Setting annotation background covers arrow · Issue #4400 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Setting annotation background covers arrow #4400
Closed
@ndevenish

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

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

      0