mpldatacursor icon indicating copy to clipboard operation
mpldatacursor copied to clipboard

Warning when used with surface plots

Open bwohlberg opened this issue 7 years ago • 1 comments

The data cursor seems to function correctly when used with a surface plot, but the first click to place the cursor results in the warning

/usr/lib/python3/dist-packages/matplotlib/collections.py:360: UserWarning: Collection picker None could not be converted to float % self._picker)

Minimal example demonstrating the problem below:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import mpldatacursor as mpldc

x = np.linspace(-1, 1, 10)[np.newaxis]
y = x.T
z = np.sqrt(x**2 + y**2)

fig = plt.figure()
ax = plt.axes(projection='3d')
xg, yg = np.meshgrid(x, y)
ax.plot_surface(xg, yg, z, rstride=1, cstride=1)
mpldc.datacursor()
plt.show()

bwohlberg avatar Mar 18 '17 19:03 bwohlberg

That is a harmless warning that has (iirc) been fixed upstream.

tacaswell avatar May 01 '17 04:05 tacaswell