()
| 393 | |
| 394 | @pytest.mark.backend("pgf") |
| 395 | def test_sketch_params(): |
| 396 | fig, ax = plt.subplots(figsize=(3, 3)) |
| 397 | ax.set_xticks([]) |
| 398 | ax.set_yticks([]) |
| 399 | ax.set_frame_on(False) |
| 400 | handle, = ax.plot([0, 1]) |
| 401 | handle.set_sketch_params(scale=5, length=30, randomness=42) |
| 402 | |
| 403 | with BytesIO() as fd: |
| 404 | fig.savefig(fd, format='pgf') |
| 405 | buf = fd.getvalue().decode() |
| 406 | |
| 407 | baseline = r"""\pgfpathmoveto{\pgfqpoint{0.375000in}{0.300000in}}% |
| 408 | \pgfpathlineto{\pgfqpoint{2.700000in}{2.700000in}}% |
| 409 | \usepgfmodule{decorations}% |
| 410 | \usepgflibrary{decorations.pathmorphing}% |
| 411 | \pgfkeys{/pgf/decoration/.cd, """ \ |
| 412 | r"""segment length = 0.150000in, amplitude = 0.100000in}% |
| 413 | \pgfmathsetseed{42}% |
| 414 | \pgfdecoratecurrentpath{random steps}% |
| 415 | \pgfusepath{stroke}%""" |
| 416 | # \pgfdecoratecurrentpath must be after the path definition and before the |
| 417 | # path is used (\pgfusepath) |
| 418 | assert baseline in buf |
| 419 | |
| 420 | |
| 421 | # test to make sure that the document font size is set consistently (see #26892) |
nothing calls this directly
no test coverage detected
searching dependent graphs…