Skip to content

issues with errorbar #83

Open
Open
@jacobpierce1

Description

@jacobpierce1

Hi, thanks for the excellent library. I am trying to extend the basic example of matplotlib.pyplot.scatter to matplotlib.pyplot.errorbar without success. Example code:

import numpy as np
import matplotlib.pyplot as plt
import mpldatacursor

x, y, z = np.random.random((3, 10))
fig, ax = plt.subplots()

# works as expected with this uncommented:
# ax.scatter(x, y, label = 'test' )

# doesn't work with an errorbar:
ax.errorbar(x, y, xerr=1, yerr=1, ls='none', label = 'test' )



mpldatacursor.datacursor( formatter = '{label}'.format )
plt.show( )
 

The expected behavior is that when one of the errorbars is clicked on, the mpldatacursor will show 'test', as it does with the scatter plot. Instead, it shows '_nolegend_'. Not sure if it's a bug or if I'm just not using the mpldatacursor correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions