MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_savefig_transparent

Function test_savefig_transparent

lib/matplotlib/tests/test_figure.py:673–691  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

671@mpl.rc_context({"savefig.transparent": True})
672@check_figures_equal()
673def test_savefig_transparent(fig_test, fig_ref):
674 # create two transparent subfigures with corresponding transparent inset
675 # axes. the entire background of the image should be transparent.
676 gs1 = fig_test.add_gridspec(3, 3, left=0.05, wspace=0.05)
677 f1 = fig_test.add_subfigure(gs1[:, :])
678 f2 = f1.add_subfigure(gs1[0, 0])
679
680 ax12 = f2.add_subplot(gs1[:, :])
681
682 ax1 = f1.add_subplot(gs1[:-1, :])
683 iax1 = ax1.inset_axes([.1, .2, .3, .4])
684 iax2 = iax1.inset_axes([.1, .2, .3, .4])
685
686 ax2 = fig_test.add_subplot(gs1[-1, :-1])
687 ax3 = fig_test.add_subplot(gs1[-1, -1])
688
689 for ax in [ax12, ax1, iax1, iax2, ax2, ax3]:
690 ax.set(xticks=[], yticks=[])
691 ax.spines[:].set_visible(False)
692
693
694def test_figure_repr():

Callers

nothing calls this directly

Calls 6

add_gridspecMethod · 0.80
add_subfigureMethod · 0.80
add_subplotMethod · 0.80
inset_axesMethod · 0.80
setMethod · 0.45
set_visibleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…