@@ -1822,28 +1822,31 @@ def test_stairs(fig_test, fig_ref):
1822
1822
test_axes [5 ].stairs (y , x , orientation = 'horizontal' )
1823
1823
test_axes [5 ].semilogx ()
1824
1824
1825
+ # defaults of `PathPatch` to be used for all following Line2D
1826
+ style = {'solid_joinstyle' : 'miter' , 'solid_capstyle' : 'butt' }
1827
+
1825
1828
ref_axes = fig_ref .subplots (3 , 2 ).flatten ()
1826
- ref_axes [0 ].plot (x , np .append (y , y [- 1 ]), drawstyle = 'steps-post' )
1827
- ref_axes [1 ].plot (np .append (y [0 ], y ), x , drawstyle = 'steps-post' )
1829
+ ref_axes [0 ].plot (x , np .append (y , y [- 1 ]), drawstyle = 'steps-post' , ** style )
1830
+ ref_axes [1 ].plot (np .append (y [0 ], y ), x , drawstyle = 'steps-post' , ** style )
1828
1831
1829
- ref_axes [2 ].plot (x , np .append (y , y [- 1 ]), drawstyle = 'steps-post' )
1830
- ref_axes [2 ].add_line (mlines .Line2D ([x [0 ], x [0 ]], [0 , y [0 ]]))
1831
- ref_axes [2 ].add_line (mlines .Line2D ([x [- 1 ], x [- 1 ]], [0 , y [- 1 ]]))
1832
+ ref_axes [2 ].plot (x , np .append (y , y [- 1 ]), drawstyle = 'steps-post' , ** style )
1833
+ ref_axes [2 ].add_line (mlines .Line2D ([x [0 ], x [0 ]], [0 , y [0 ]], ** style ))
1834
+ ref_axes [2 ].add_line (mlines .Line2D ([x [- 1 ], x [- 1 ]], [0 , y [- 1 ]], ** style ))
1832
1835
ref_axes [2 ].set_ylim (0 , None )
1833
1836
1834
- ref_axes [3 ].plot (np .append (y [0 ], y ), x , drawstyle = 'steps-post' )
1835
- ref_axes [3 ].add_line (mlines .Line2D ([0 , y [0 ]], [x [0 ], x [0 ]]))
1836
- ref_axes [3 ].add_line (mlines .Line2D ([0 , y [- 1 ]], [x [- 1 ], x [- 1 ]]))
1837
+ ref_axes [3 ].plot (np .append (y [0 ], y ), x , drawstyle = 'steps-post' , ** style )
1838
+ ref_axes [3 ].add_line (mlines .Line2D ([0 , y [0 ]], [x [0 ], x [0 ]], ** style ))
1839
+ ref_axes [3 ].add_line (mlines .Line2D ([0 , y [- 1 ]], [x [- 1 ], x [- 1 ]], ** style ))
1837
1840
ref_axes [3 ].set_xlim (0 , None )
1838
1841
1839
- ref_axes [4 ].plot (x , np .append (y , y [- 1 ]), drawstyle = 'steps-post' )
1840
- ref_axes [4 ].add_line (mlines .Line2D ([x [0 ], x [0 ]], [0 , y [0 ]]))
1841
- ref_axes [4 ].add_line (mlines .Line2D ([x [- 1 ], x [- 1 ]], [0 , y [- 1 ]]))
1842
+ ref_axes [4 ].plot (x , np .append (y , y [- 1 ]), drawstyle = 'steps-post' , ** style )
1843
+ ref_axes [4 ].add_line (mlines .Line2D ([x [0 ], x [0 ]], [0 , y [0 ]], ** style ))
1844
+ ref_axes [4 ].add_line (mlines .Line2D ([x [- 1 ], x [- 1 ]], [0 , y [- 1 ]], ** style ))
1842
1845
ref_axes [4 ].semilogy ()
1843
1846
1844
- ref_axes [5 ].plot (np .append (y [0 ], y ), x , drawstyle = 'steps-post' )
1845
- ref_axes [5 ].add_line (mlines .Line2D ([0 , y [0 ]], [x [0 ], x [0 ]]))
1846
- ref_axes [5 ].add_line (mlines .Line2D ([0 , y [- 1 ]], [x [- 1 ], x [- 1 ]]))
1847
+ ref_axes [5 ].plot (np .append (y [0 ], y ), x , drawstyle = 'steps-post' , ** style )
1848
+ ref_axes [5 ].add_line (mlines .Line2D ([0 , y [0 ]], [x [0 ], x [0 ]], ** style ))
1849
+ ref_axes [5 ].add_line (mlines .Line2D ([0 , y [- 1 ]], [x [- 1 ], x [- 1 ]], ** style ))
1847
1850
ref_axes [5 ].semilogx ()
1848
1851
1849
1852
@@ -1861,15 +1864,15 @@ def test_stairs_fill(fig_test, fig_ref):
1861
1864
1862
1865
# # Ref
1863
1866
ref_axes = fig_ref .subplots (2 , 2 ).flatten ()
1864
- ref_axes [0 ].fill_between (bins , np .append (h , h [- 1 ]), step = 'post' )
1867
+ ref_axes [0 ].fill_between (bins , np .append (h , h [- 1 ]), step = 'post' , lw = 0 )
1865
1868
ref_axes [0 ].set_ylim (0 , None )
1866
- ref_axes [1 ].fill_betweenx (bins , np .append (h , h [- 1 ]), step = 'post' )
1869
+ ref_axes [1 ].fill_betweenx (bins , np .append (h , h [- 1 ]), step = 'post' , lw = 0 )
1867
1870
ref_axes [1 ].set_xlim (0 , None )
1868
1871
ref_axes [2 ].fill_between (bins , np .append (h , h [- 1 ]),
1869
- np .ones (len (h )+ 1 )* bs , step = 'post' )
1872
+ np .ones (len (h )+ 1 )* bs , step = 'post' , lw = 0 )
1870
1873
ref_axes [2 ].set_ylim (bs , None )
1871
1874
ref_axes [3 ].fill_betweenx (bins , np .append (h , h [- 1 ]),
1872
- np .ones (len (h )+ 1 )* bs , step = 'post' )
1875
+ np .ones (len (h )+ 1 )* bs , step = 'post' , lw = 0 )
1873
1876
ref_axes [3 ].set_xlim (bs , None )
1874
1877
1875
1878
0 commit comments