Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Handling pick events does not work on logarithmic axes. See the example below. As long as the line statementax.set_xscale('log')
is commented out, clicking on the polygons created byaxvspan
xauses them to change from gray to red. Uncomment that line to make the x axis logarithmic, and clicking on the polygons has either no effect or is misdirected to the far-left polygon only.
frommatplotlibimportpyplotaspltfig=plt.figure()ax=fig.add_subplot(111)ax.set_xlim(1,10)foriinrange(1,10,3):ax.axvspan(i,i+1,color='gray',picker=True)# uncomment this line to break the picker# ax.set_xscale('log')defonpick(event):event.artist.set_color('red')fig.canvas.draw()fig.canvas.mpl_connect('pick_event',onpick)plt.show()
Tested on version 1.4.0 and master as of04496b0 on Mac OS X Mavericks.
[TAC edited for formatting]