class_docstr: Test using matplotlib styling to modify look of graphic.
class_docstr_tok: ["Test","using","matplotlib","styling","to","modify","look","of","graphic","."]
docstr: Test that selecting style as draw_mpl(circuit, style=None) does not modify the users
  general matplotlib plotting settings
docstr_tok: ["Test","that","selecting","style","as","draw_mpl","(","circuit",",","style=None",")","does","not","modify","the","users","general","matplotlib","plotting","settings"]
code: def test_style_restores_settings(self):
      """Test that selecting style as draw_mpl(circuit, style=None) does not modify the users
      general matplotlib plotting settings"""
  
      initial_facecolor = mpl.rcParams["axes.facecolor"]
      initial_patch_facecolor = mpl.rcParams["patch.facecolor"]
      initial_patch_edgecolor = mpl.rcParams["patch.edgecolor"]
  
      # confirm settings were updated for the draw_mpl plot
      _, ax = qml.draw_mpl(circuit1, style="sketch")(1.234, 1.234)
      assert ax.get_facecolor() == (
          0.8392156862745098,
          0.9607843137254902,
          0.8862745098039215,
          1.0,
      )
      assert ax.patches[3].get_facecolor() == (
          0.8392156862745098,
          0.9607843137254902,
          0.8862745098039215,
          1.0,
      )
      assert ax.patches[3].get_edgecolor() == (0.0, 0.0, 0.0, 1.0)
  
      # confirm general matplotlib settings were reset after plotting
      assert mpl.rcParams["axes.facecolor"] == initial_facecolor
      assert mpl.rcParams["patch.facecolor"] == initial_patch_facecolor
      assert mpl.rcParams["patch.edgecolor"] == initial_patch_edgecolor
  
imports: import pytest
  import pennylane
label_desc: Use image node_id 3 for calling the TestMPLIntegration obj's underlying member method code with example usage: obj.test_style_restores_settings() without return types