@@ -962,8 +962,8 @@ def test_poly3dcollection_closed():
962
962
facecolor = (0.5 , 0.5 , 1 , 0.5 ), closed = True )
963
963
c2 = art3d .Poly3DCollection ([poly2 ], linewidths = 3 , edgecolor = 'k' ,
964
964
facecolor = (1 , 0.5 , 0.5 , 0.5 ), closed = False )
965
- ax .add_collection3d (c1 )
966
- ax .add_collection3d (c2 )
965
+ ax .add_collection3d (c1 , autolim = False )
966
+ ax .add_collection3d (c2 , autolim = False )
967
967
968
968
969
969
def test_poly_collection_2d_to_3d_empty ():
@@ -996,8 +996,8 @@ def test_poly3dcollection_alpha():
996
996
c2 .set_facecolor ((1 , 0.5 , 0.5 ))
997
997
c2 .set_edgecolor ('k' )
998
998
c2 .set_alpha (0.5 )
999
- ax .add_collection3d (c1 )
1000
- ax .add_collection3d (c2 )
999
+ ax .add_collection3d (c1 , autolim = False )
1000
+ ax .add_collection3d (c2 , autolim = False )
1001
1001
1002
1002
1003
1003
@mpl3d_image_comparison (['add_collection3d_zs_array.png' ], style = 'mpl20' )
@@ -1056,6 +1056,32 @@ def test_add_collection3d_zs_scalar():
1056
1056
ax .set_zlim (0 , 2 )
1057
1057
1058
1058
1059
+ def test_line3dCollection_autoscaling ():
1060
+ fig = plt .figure ()
1061
+ ax = fig .add_subplot (projection = '3d' )
1062
+
1063
+ lines = [[(0 , 0 , 0 ), (1 , 4 , 2 )],
1064
+ [(1 , 1 , 3 ), (2 , 0 , 2 )],
1065
+ [(1 , 0 , 4 ), (1 , 4 , 5 )]]
1066
+
1067
+ lc = art3d .Line3DCollection (lines )
1068
+ ax .add_collection3d (lc )
1069
+ assert np .allclose (ax .get_xlim3d (), (- 0.041666666666666664 , 2.0416666666666665 ))
1070
+ assert np .allclose (ax .get_ylim3d (), (- 0.08333333333333333 , 4.083333333333333 ))
1071
+ assert np .allclose (ax .get_zlim3d (), (- 0.10416666666666666 , 5.104166666666667 ))
1072
+
1073
+
1074
+ def test_poly3dCollection_autoscaling ():
1075
+ fig = plt .figure ()
1076
+ ax = fig .add_subplot (projection = '3d' )
1077
+ poly = np .array ([[0 , 0 , 0 ], [1 , 1 , 3 ], [1 , 0 , 4 ]])
1078
+ col = art3d .Poly3DCollection ([poly ])
1079
+ ax .add_collection3d (col )
1080
+ assert np .allclose (ax .get_xlim3d (), (- 0.020833333333333332 , 1.0208333333333333 ))
1081
+ assert np .allclose (ax .get_ylim3d (), (- 0.020833333333333332 , 1.0208333333333333 ))
1082
+ assert np .allclose (ax .get_zlim3d (), (- 0.0833333333333333 , 4.083333333333333 ))
1083
+
1084
+
1059
1085
@mpl3d_image_comparison (['axes3d_labelpad.png' ],
1060
1086
remove_text = False , style = 'mpl20' )
1061
1087
def test_axes3d_labelpad ():
0 commit comments