@@ -606,6 +606,28 @@ def test_connection_patch_fig(fig_test, fig_ref):
606606 fig_ref .add_artist (con )
607607
608608
609+ @check_figures_equal (extensions = ["png" ])
610+ def test_connection_patch_pixel_points (fig_test , fig_ref ):
611+ xyA_pts = (.3 , .2 )
612+ xyB_pts = (- 30 , - 20 )
613+
614+ ax1 , ax2 = fig_test .subplots (1 , 2 )
615+ con = mpatches .ConnectionPatch (xyA = xyA_pts , coordsA = "axes points" , axesA = ax1 ,
616+ xyB = xyB_pts , coordsB = "figure points" ,
617+ arrowstyle = "->" , shrinkB = 5 )
618+ fig_test .add_artist (con )
619+
620+ plt .rcParams ["savefig.dpi" ] = plt .rcParams ["figure.dpi" ]
621+
622+ ax1 , ax2 = fig_ref .subplots (1 , 2 )
623+ xyA_pix = (xyA_pts [0 ]* (fig_ref .dpi / 72 ), xyA_pts [1 ]* (fig_ref .dpi / 72 ))
624+ xyB_pix = (xyB_pts [0 ]* (fig_ref .dpi / 72 ), xyB_pts [1 ]* (fig_ref .dpi / 72 ))
625+ con = mpatches .ConnectionPatch (xyA = xyA_pix , coordsA = "axes pixels" , axesA = ax1 ,
626+ xyB = xyB_pix , coordsB = "figure pixels" ,
627+ arrowstyle = "->" , shrinkB = 5 )
628+ fig_ref .add_artist (con )
629+
630+
609631def test_datetime_rectangle ():
610632 # Check that creating a rectangle with timedeltas doesn't fail
611633 from datetime import datetime , timedelta
0 commit comments