@@ -692,6 +692,32 @@ def midpoints(x):
692
692
edgecolors = np .clip (2 * colors - 0.5 , 0 , 1 ), # brighter
693
693
linewidth = 0.5 )
694
694
695
+ def test_calling_conventions (self ):
696
+ x , y , z = np .indices ((3 , 4 , 5 ))
697
+ filled = np .ones ((2 , 3 , 4 ))
698
+
699
+ fig , ax = plt .subplots (subplot_kw = {"projection" : "3d" })
700
+
701
+ # all the valid calling conventions
702
+ for kw in (dict (), dict (edgecolor = 'k' )):
703
+ ax .voxels (filled , ** kw )
704
+ ax .voxels (filled = filled , ** kw )
705
+ ax .voxels (x , y , z , filled , ** kw )
706
+ ax .voxels (x , y , z , filled = filled , ** kw )
707
+
708
+ # duplicate argument
709
+ with pytest .raises (TypeError ) as exc :
710
+ ax .voxels (x , y , z , filled , filled = filled )
711
+ exc .match (".*voxels.*" )
712
+ # missing arguments
713
+ with pytest .raises (TypeError ) as exc :
714
+ ax .voxels (x , y )
715
+ exc .match (".*voxels.*" )
716
+ # x,y,z are positional only - this passes them on as attributes of
717
+ # Poly3DCollection
718
+ with pytest .raises (AttributeError ):
719
+ ax .voxels (filled = filled , x = x , y = y , z = z )
720
+
695
721
696
722
def test_inverted_cla ():
697
723
# Github PR #5450. Setting autoscale should reset
0 commit comments