docstr: Test st.pyplot.
  
  Need to test:
  * Failed import of matplotlib.
  * Passing in a figure.
docstr_tok: ["Test","st.pyplot",".","Need","to","test",":","*","Failed","import","of","matplotlib",".","*","Passing","in","a","figure","."]
code: def test_st_pyplot(self):
      """Test st.pyplot.
  
      Need to test:
      * Failed import of matplotlib.
      * Passing in a figure.
      """
  
      # Make this deterministic
      np.random.seed(19680801)
      data = np.random.randn(2, 20)
  
      # Generate a 2 inch x 2 inch figure
      fig, ax = plt.subplots(figsize=(2, 2))
      # Add 20 random points to scatter plot.
      ax.scatter(data[0], data[1])
  
      st.pyplot(fig)
  
      el = self.get_delta_from_queue().new_element
      self.assertEqual(el.imgs.width, -2)
      self.assertEqual(el.imgs.imgs[0].caption, "")
      self.assertTrue(el.imgs.imgs[0].url.startswith(MEDIA_ENDPOINT))
  
file_path: streamlit/lib/tests/streamlit/elements/pyplot_test.py
imports: from typing import Optional
  from unittest.mock import patch
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from parameterized import parameterized
  import streamlit
  from streamlit.elements import image
  from streamlit.web.server.server import MEDIA_ENDPOINT
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
label_desc: Use image node_id 3 for calling the PyplotTest obj's underlying member method code with example usage: obj.test_st_pyplot() without return types