code: def test_normal_mpl_dates(self):
      datetime_format = "%Y-%m-%d %H:%M:%S"
      y = [1, 2, 3, 4]
      date_strings = [
          "2010-01-04 00:00:00",
          "2010-01-04 10:00:00",
          "2010-01-04 23:00:59",
          "2010-01-05 00:00:00",
      ]
  
      # 1. create datetimes from the strings
      dates = [
          datetime.datetime.strptime(date_string, datetime_format)
          for date_string in date_strings
      ]
  
      # 2. create the mpl_dates from these datetimes
      mpl_dates = date2num(dates)
  
      # make a figure in mpl
      fig, ax = plt.subplots()
      ax.plot_date(mpl_dates, y)
  
      # convert this figure to plotly's graph_objs
      pfig = tls.mpl_to_plotly(fig)
  
      print(date_strings)
      print(pfig["data"][0]["x"])
      # we use the same format here, so we expect equality here
      self.assertEqual(
          fig.axes[0].lines[0].get_xydata()[0][0], 7.33776000e05
      )
      self.assertEqual(tuple(pfig["data"][0]["x"]), tuple(date_strings))
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_date_times.py
imports: import datetime
  import random
  from unittest import TestCase
  import pytest
  import pandas
  import plotly.tools
  from plotly import optional_imports
label_desc: Use image node_id 1 for calling the TestDateTimes obj's underlying member method code with example usage: obj.test_normal_mpl_dates() without return types