@@ -6513,3 +6513,22 @@ def test_multiplot_autoscale():
6513
6513
ax2 .axhspan (- 5 , 5 )
6514
6514
xlim = ax1 .get_xlim ()
6515
6515
assert np .allclose (xlim , [0.5 , 4.5 ])
6516
+
6517
+
6518
+ @check_figures_equal (extensions = ["pdf" ])
6519
+ def test_2dcolor_plot (fig_test , fig_ref ):
6520
+ color = np .array ([0.1 , 0.2 , 0.3 ])
6521
+ # plot with 1D-color:
6522
+ axs = fig_test .subplots (5 )
6523
+ axs [0 ].plot ([1 , 2 ], [1 , 2 ], c = color .reshape ((- 1 )))
6524
+ axs [1 ].scatter ([1 , 2 ], [1 , 2 ], c = color .reshape ((- 1 )))
6525
+ axs [2 ].step ([1 , 2 ], [1 , 2 ], c = color .reshape ((- 1 )))
6526
+ axs [3 ].hist (np .arange (10 ), color = color .reshape ((- 1 )))
6527
+ axs [4 ].bar (np .arange (10 ), np .arange (10 ), color = color .reshape ((- 1 )))
6528
+ # plot with 2D-color:
6529
+ axs = fig_ref .subplots (5 )
6530
+ axs [0 ].plot ([1 , 2 ], [1 , 2 ], c = color .reshape ((1 , - 1 )))
6531
+ axs [1 ].scatter ([1 , 2 ], [1 , 2 ], c = color .reshape ((1 , - 1 )))
6532
+ axs [2 ].step ([1 , 2 ], [1 , 2 ], c = color .reshape ((1 , - 1 )))
6533
+ axs [3 ].hist (np .arange (10 ), color = color .reshape ((1 , - 1 )))
6534
+ axs [4 ].bar (np .arange (10 ), np .arange (10 ), color = color .reshape ((1 , - 1 )))
0 commit comments