@@ -6590,3 +6590,22 @@ def test_sharing_does_not_link_positions():
65906590 init_pos = ax1 .get_position ()
65916591 fig .subplots_adjust (left = 0 )
65926592 assert (ax1 .get_position ().get_points () == init_pos .get_points ()).all ()
6593+
6594+
6595+ @check_figures_equal (extensions = ["pdf" ])
6596+ def test_2dcolor_plot (fig_test , fig_ref ):
6597+ color = np .array ([0.1 , 0.2 , 0.3 ])
6598+ # plot with 1D-color:
6599+ axs = fig_test .subplots (5 )
6600+ axs [0 ].plot ([1 , 2 ], [1 , 2 ], c = color .reshape (- 1 ))
6601+ axs [1 ].scatter ([1 , 2 ], [1 , 2 ], c = color .reshape (- 1 ))
6602+ axs [2 ].step ([1 , 2 ], [1 , 2 ], c = color .reshape (- 1 ))
6603+ axs [3 ].hist (np .arange (10 ), color = color .reshape (- 1 ))
6604+ axs [4 ].bar (np .arange (10 ), np .arange (10 ), color = color .reshape (- 1 ))
6605+ # plot with 2D-color:
6606+ axs = fig_ref .subplots (5 )
6607+ axs [0 ].plot ([1 , 2 ], [1 , 2 ], c = color .reshape ((1 , - 1 )))
6608+ axs [1 ].scatter ([1 , 2 ], [1 , 2 ], c = color .reshape ((1 , - 1 )))
6609+ axs [2 ].step ([1 , 2 ], [1 , 2 ], c = color .reshape ((1 , - 1 )))
6610+ axs [3 ].hist (np .arange (10 ), color = color .reshape ((1 , - 1 )))
6611+ axs [4 ].bar (np .arange (10 ), np .arange (10 ), color = color .reshape ((1 , - 1 )))
0 commit comments