You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Nan values in scatter 3d plot show in black colour when alpha parameter is passed. #25446
In a projection='3d' axis, a scatter plot with the c argument to colour the points is showing black markers in the position of nan values if the alpha argument is passed. If the alpha argument is not present, the nan values are not displayed, as expected. If the alpha argument is present, even with alpha = 1, the markers are coloured black.
Hello! Me and @eirinikafourou are students at the Department of Management Science and Technology in Athens University of Economics and Business and as a part of our class (Applied Software Engineering) we should contribute to an OS project. Could we handle this issue?
Activity
ricmperes commentedon Mar 13, 2023
In a 2d projection the issue does not happen and both alpha and nan values work as expected.
tacaswell commentedon Mar 14, 2023
The default color for "bad" in the color maps is (0, 0, 0, 0) which if alpha gets set to 1 is black.
My guess (without digging into the code) is that we are setting the alpha rather than multiplyin the alpha when it is set by the user....
evgepab commentedon Mar 14, 2023
Hello! Me and @eirinikafourou are students at the Department of Management Science and Technology in Athens University of Economics and Business and as a part of our class (Applied Software Engineering) we should contribute to an OS project. Could we handle this issue?
tacaswell commentedon Mar 15, 2023
We do not really assign issues, so please feel free to work on this (or any other issue).
oscargus commentedon Mar 16, 2023
Seems like @tacaswell guess is correct:
matplotlib/lib/mpl_toolkits/mplot3d/art3d.py
Lines 764 to 772 in 63b9b04
The original alpha values are dropped at the first line and then a single alpha value is set at the last line.
The solution would probably be to store the original alpha values and then concatenate them back (multiplied with
self._alpha) at the last line.