| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Looks like a real doc-build failure.... :-( generating gallery for gallery/mplot3d... [ 2%] 2dcollections3d.py
WARNING: /home/circleci/project/examples/mplot3d/2dcollections3d.py failed to execute correctly: Traceback (most recent call last):
File "/home/circleci/project/examples/mplot3d/2dcollections3d.py", line 36, in <module>
ax.legend()
File "/home/circleci/project/lib/matplotlib/axes/_axes.py", line 290, in legend
self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
File "/home/circleci/project/lib/matplotlib/legend.py", line 503, in __init__
self._init_legend_box(handles, labels, markerfirst)
File "/home/circleci/project/lib/matplotlib/legend.py", line 766, in _init_legend_box
handle_list.append(handler.legend_artist(self, orig_handle,
File "/home/circleci/project/lib/matplotlib/legend_handler.py", line 115, in legend_artist
artists = self.create_artists(legend, orig_handle,
File "/home/circleci/project/lib/matplotlib/legend_handler.py", line 447, in create_artists
p = self.create_collection(orig_handle, sizes,
File "/home/circleci/project/lib/matplotlib/legend_handler.py", line 459, in create_collection
p = type(orig_handle)([orig_handle.get_paths()[0]],
File "/home/circleci/project/lib/mpl_toolkits/mplot3d/art3d.py", line 525, in __init__
super().__init__(*args, **kwargs)
File "/home/circleci/project/lib/matplotlib/collections.py", line 1029, in __init__
super().__init__(**kwargs)
File "/home/circleci/project/lib/matplotlib/_api/deprecation.py", line 421, in wrapper
return func(*inner_args, **inner_kwargs)
File "/home/circleci/project/lib/matplotlib/collections.py", line 180, in __init__
self.set_linewidth(linewidths)
File "/home/circleci/project/lib/mpl_toolkits/mplot3d/art3d.py", line 570, in set_linewidth
if not self._in_draw:
AttributeError: 'Path3DCollection' object has no attribute '_in_draw'
|
Sorry, something went wrong.
|
No, I jumped to conclusion, but it is an easy fix. Running a full docs build locally before pushing. |
Sorry, something went wrong.
|
I think you're running into the same issue as #18932 did, namely that legend copies the class, and so creates a 3D collection for its legend handle, without doing any of the 3D work. |
Sorry, something went wrong.
|
I think this is slightly different, the problem is it is actually creating a the 3D class, rather than the slightly-upsetting matplotlib/lib/mpl_toolkits/mplot3d/art3d.py Lines 705 to 728 in bba76b8 |
Sorry, something went wrong.
|
Going to make an executive decision and say that @QuLogic can merge this on one review so we can get 3.4.1 out. |
Sorry, something went wrong.
There was a problem hiding this comment.
I have minor comments, and I'll leave this open for a little bit in case anyone else is able to review.
Sorry, something went wrong.
This fixes matplotlib#19787 This modifies the way we manage internal depth sorting of elements in the 3D collections. We need to both preserve the original order (so we can keep the position, size, colour, ... in sync), but present each of them to the 2D rendering code in depth order (back to front). In some cases we can handle this by sorting the values in the getter methods and in others we have to keep a cache of both the sorted (the names used by the 2D code) and unsorted (post-fixed with 3d) data. It does not appear that Line3DCollection does any of the z-sorting that the other collections do. While definitely a limitation and produces MC Escher effects, this is out of scope of the current work. The z-sorting on Poly3DCollection is significantly more sophisticated than the sorting on Path3DCollection and Patch3DCollection so it is handled differently. Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Backport PR #19812: FIX: size and color rendering for Path3DCollection
| Back | FazBrowse Home | New Git URL |
PR Summary
This fixes both bugs identified in #19787
Still needs test and the tactic should be expanded to the other *Collections before we merge.