def test_markers(benchmark, axes, sample_vectors, canvas_cls, threshold, marker, marker_threads, cairo_circles): mplcairo.set_options(marker_threads=marker_threads, cairo_circles=cairo_circles) with mpl.rc_context({"path.simplify_threshold": threshold}): axes.plot(*sample_vectors, linestyle="none", marker=marker) despine(axes) axes.figure.canvas = canvas_cls(axes.figure) benchmark(axes.figure.canvas.draw) mplcairo.set_options(marker_threads=0, cairo_circles=False)
def test_scatter_multisize(benchmark, axes, sample_vectors, canvas_cls, threshold, marker, marker_threads, cairo_circles): mplcairo.set_options(marker_threads=marker_threads, cairo_circles=cairo_circles) with mpl.rc_context({"path.simplify_threshold": threshold}): a, b = sample_vectors axes.scatter(a, a, s=100 * b**2, marker=marker) despine(axes) axes.figure.canvas = canvas_cls(axes.figure) benchmark(axes.figure.canvas.draw) mplcairo.set_options(marker_threads=0, cairo_circles=False)
def axes(): mpl.rcdefaults() mplcairo.set_options(cairo_circles=True, raqm=False) return Figure().subplots()