@@ -6343,3 +6343,61 @@ def test_invisible_axes():
6343
6343
assert fig .canvas .inaxes ((200 , 200 )) is not None
6344
6344
ax .set_visible (False )
6345
6345
assert fig .canvas .inaxes ((200 , 200 )) is None
6346
+
6347
+ @check_figures_equal ()
6348
+ def test_scatter_autoscaling_w_zero_xy (fig_test , fig_ref ):
6349
+ x_vals = [0 , 4.38462e-06 , 5.54929e-06 , 7.02332e-06 , 8.88889e-06 ]
6350
+ y_vals = [0 , 0.10000000000000002 , 0.182 , 0.332 , 0.604 ]
6351
+
6352
+ pts = np .array (list (itertools .product (x_vals , y_vals ))) # This converts the values to a numpy array
6353
+
6354
+ ax_test = fig_test .gca ()
6355
+ ax_test .set_yscale ('log' )
6356
+ ax_test .plot (pts [:,0 ], pts [:,1 ], marker = "o" , ls = "" )
6357
+
6358
+ ax_ref = fig_ref .gca ()
6359
+ ax_ref .set_yscale ('log' )
6360
+ ax_ref .plot (pts [:,0 ], pts [:,1 ], marker = "o" , ls = "" )
6361
+
6362
+ def test_scatter_autoscaling_w_zero_x (fig_test , fig_ref ):
6363
+ x_vals = [0 , 4.38462e-06 , 5.54929e-06 , 7.02332e-06 , 8.88889e-06 ]
6364
+ y_vals = [0.10000000000000002 , 0.182 , 0.332 , 0.604 ]
6365
+
6366
+ pts = np .array (list (itertools .product (x_vals , y_vals ))) # This converts the values to a numpy array
6367
+
6368
+ ax_test = fig_test .gca ()
6369
+ ax_test .set_yscale ('log' )
6370
+ ax_test .plot (pts [:,0 ], pts [:,1 ], marker = "o" , ls = "" )
6371
+
6372
+ ax_ref = fig_ref .gca ()
6373
+ ax_ref .set_yscale ('log' )
6374
+ ax_ref .plot (pts [:,0 ], pts [:,1 ], marker = "o" , ls = "" )
6375
+
6376
+ def test_scatter_autoscaling_w_zero_y (fig_test , fig_ref ):
6377
+ x_vals = [4.38462e-06 , 5.54929e-06 , 7.02332e-06 , 8.88889e-06 ]
6378
+ y_vals = [0 , 0.10000000000000002 , 0.182 , 0.332 , 0.604 ]
6379
+
6380
+ pts = np .array (list (itertools .product (x_vals , y_vals ))) # This converts the values to a numpy array
6381
+
6382
+ ax_test = fig_test .gca ()
6383
+ ax_test .set_yscale ('log' )
6384
+ ax_test .plot (pts [:,0 ], pts [:,1 ], marker = "o" , ls = "" )
6385
+
6386
+ ax_ref = fig_ref .gca ()
6387
+ ax_ref .set_yscale ('log' )
6388
+ ax_ref .plot (pts [:,0 ], pts [:,1 ], marker = "o" , ls = "" )
6389
+
6390
+ def test_scatter_autoscaling_wo_zero (fig_test , fig_ref ):
6391
+ x_vals = [4.38462e-06 , 5.54929e-06 , 7.02332e-06 , 8.88889e-06 ]
6392
+ y_vals = [0.10000000000000002 , 0.182 , 0.332 , 0.604 ]
6393
+
6394
+ pts = np .array (list (itertools .product (x_vals , y_vals ))) # This converts the values to a numpy array
6395
+
6396
+ ax_test = fig_test .gca ()
6397
+ ax_test .set_yscale ('log' )
6398
+ ax_test .plot (pts [:,0 ], pts [:,1 ], marker = "o" , ls = "" )
6399
+
6400
+ ax_ref = fig_ref .gca ()
6401
+ ax_ref .set_yscale ('log' )
6402
+ ax_ref .plot (pts [:,0 ], pts [:,1 ], marker = "o" , ls = "" )
6403
+
0 commit comments