-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
remove _ensure_plottable #5763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
remove _ensure_plottable #5763
Conversation
The plotting backend does more reliable checking and thus removing avoids false negatives, which are causing easily avoidable plot failures
Hello @dschwoerer! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-10-24 10:33:03 UTC |
Thanks @dschwoerer This makes sense to me. A lot of failed tests are checking for the raised error. We will need to update these to make sure the plotting worked. |
I think there are several options:
Which of these options would you prefer? |
The error for multiindex plotting is not very informative "setting array element with sequence" so I would still keep for the tests that now work, we should check that the output is reasonable, so I wouldn't delete them |
What would you expect the plot to look like if you input a complex number or a multiindex along the x-axis? x = 1j * np.arange(0, 5)
y = np.arange(5, 10)
plt.plot(x, y)
ComplexWarning: Casting complex values to real discards the imaginary part
return np.asarray(x, float) x = 1j * np.arange(0, 5)
y = np.arange(5, 10)
plt.plot(np.vectorize(str)(x), y) x = 1j + np.arange(0, 5)
y = np.arange(5, 10)
plt.plot(np.vectorize(str)(x), y) import pandas as pd
arrays = [[1, 1, 2, 2], ['red', 'blue', 'red', 'blue']]
a = pd.MultiIndex.from_arrays(arrays, names=('number', 'color')).to_numpy()
b = np.arange(4, 8)
plt.plot(np.vectorize(str)(a), b) |
The plotting backend does more reliable checking and thus removing avoids
false negatives, which are causing easily avoidable plot failures
pre-commit run --all-files
whats-new.rst
api.rst