(fig_test, fig_ref)
| 201 | |
| 202 | @check_figures_equal() |
| 203 | def test_dash_offset_patch_draw(fig_test, fig_ref): |
| 204 | ax_test = fig_test.add_subplot() |
| 205 | ax_ref = fig_ref.add_subplot() |
| 206 | |
| 207 | loc = (0.1, 0.1) |
| 208 | width, height = (0.8, 0.8) |
| 209 | rect_ref = Rectangle(loc, width, height, linewidth=3, edgecolor='b', |
| 210 | linestyle=(0, [6, 6])) |
| 211 | # fill the line gaps using a linestyle (0, [0, 6, 6, 0]), which is |
| 212 | # equivalent to (6, [6, 6]) but has 0 dash offset |
| 213 | rect_ref2 = Rectangle(loc, width, height, linewidth=3, edgecolor='r', |
| 214 | linestyle=(0, [0, 6, 6, 0])) |
| 215 | assert rect_ref.get_linestyle() == (0, [6, 6]) |
| 216 | assert rect_ref2.get_linestyle() == (0, [0, 6, 6, 0]) |
| 217 | |
| 218 | ax_ref.add_patch(rect_ref) |
| 219 | ax_ref.add_patch(rect_ref2) |
| 220 | |
| 221 | # Check that the dash offset of the rect is the same if we pass it in the |
| 222 | # init method and if we create two rects with appropriate onoff sequence |
| 223 | # of linestyle. |
| 224 | |
| 225 | rect_test = Rectangle(loc, width, height, linewidth=3, edgecolor='b', |
| 226 | linestyle=(0, [6, 6])) |
| 227 | rect_test2 = Rectangle(loc, width, height, linewidth=3, edgecolor='r', |
| 228 | linestyle=(6, [6, 6])) |
| 229 | assert rect_test.get_linestyle() == (0, [6, 6]) |
| 230 | assert rect_test2.get_linestyle() == (6, [6, 6]) |
| 231 | |
| 232 | ax_test.add_patch(rect_test) |
| 233 | ax_test.add_patch(rect_test2) |
| 234 | |
| 235 | |
| 236 | def test_negative_rect(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…