Skip to content

Event picking does not seem to work on polar bar plots #7655

Closed
@kasperloopstra1

Description

@kasperloopstra1

The minimal example provided below has been tested on Windows 10, Python 3.5.2 (Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32 ), matplotlib 1.5.3.

Running the code below results in events being printed for the Cartesian bar plot, but not for the polar bar plot. Changing the bar plots to scatter plots works for both Cartesian scatter plots and polar scatter plots.


 
#!/usr/bin/env python3
import matplotlib.pyplot as plt
 
def onpick(event):
    print(event) #Only events from fig2 are shown
    return True
rect=[.1,.1,.8,.8]
fig1 = plt.figure()
ax = fig1.add_axes(rect,polar=True)
ax.bar(1, 2,   picker=True)
fig1.canvas.mpl_connect('pick_event',onpick)

fig2 = plt.figure()
ax2 = fig2.add_axes(rect,polar=False)
ax2.bar(1, 2,  picker=True)
fig2.canvas.mpl_connect('pick_event',onpick)
plt.show()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions