title: How to fix "ValueError: view limit minimum -36881.6 is less than 1 and is an invalid Matplotlib date value."?
body: <p>I have a data frame <code>daily_data_f_no_nr</code> containing following values:</p>
  <pre><code>          Day  Total TODO/TODOE count  First Derivative
  0  2020-05-16                      35               0.0
  1  2020-05-17                      35               0.0
  2  2020-05-18                      35               0.0
  3  2020-05-19                      35               0.0
  4  2020-05-20                      35               0.0
  ..        ...                     ...               ...
  67 2020-07-22                     151               0.0
  68 2020-07-23                     151               0.0
  69 2020-07-24                     152               1.0
  70 2020-07-25                     152               0.0
  71 2020-07-26                     152               0.0
  </code></pre>
  <p>When I call <code>fig = daily_data_f_no_nr.plot(kind='line', figsize=(20, 16), fontsize=26).get_figure() </code> I get the following error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;py\todo-count-delta.py&quot;, line 112, in &lt;module&gt;
      fig = daily_data_f_no_nr.plot(kind='line', figsize=(20, 16), fontsize=26).get_figure()
    File &quot;C:\Users\User\anaconda3\lib\site-packages\pandas\plotting\_core.py&quot;, line 847, in __call__
      return plot_backend.plot(data, kind=kind, **kwargs)
    File &quot;C:\Users\User\anaconda3\lib\site-packages\pandas\plotting\_matplotlib\__init__.py&quot;, line 61, in plot
      plot_obj.generate()
    File &quot;C:\Users\User\anaconda3\lib\site-packages\pandas\plotting\_matplotlib\core.py&quot;, line 269, in generate
      self._post_plot_logic_common(ax, self.data)
    File &quot;C:\Users\User\anaconda3\lib\site-packages\pandas\plotting\_matplotlib\core.py&quot;, line 438, in _post_plot_logic_common
      self._apply_axis_properties(ax.yaxis, fontsize=self.fontsize)
    File &quot;C:\Users\User\anaconda3\lib\site-packages\pandas\plotting\_matplotlib\core.py&quot;, line 520, in _apply_axis_properties
      labels = axis.get_majorticklabels() + axis.get_minorticklabels()
    File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\axis.py&quot;, line 1252, in get_majorticklabels
      ticks = self.get_major_ticks()
    File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\axis.py&quot;, line 1407, in get_major_ticks
      numticks = len(self.get_majorticklocs())
    File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\axis.py&quot;, line 1324, in get_majorticklocs
      return self.major.locator()
    File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\dates.py&quot;, line 1428, in __call__
      self.refresh()
    File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\dates.py&quot;, line 1448, in refresh
      dmin, dmax = self.viewlim_to_dt()
    File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\dates.py&quot;, line 1199, in viewlim_to_dt
      .format(vmin))
  ValueError: view limit minimum -36881.6 is less than 1 and is an invalid Matplotlib date value. This often happens if you pass a non-datetime value to an axis that has datetime units
  </code></pre>
  <p>How can I fix it?</p>
  <p><strong>Update 1:</strong> When I change the line in question to</p>
  <pre><code>fig = daily_data_f_no_nr.plot(kind='line', figsize=(20, 16), fontsize=26, xticks='Day', yticks='Total TODO/TODOE count').get_figure()
  </code></pre>
  <p>I get the following error:</p>
  <pre><code>File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\axes\_base.py&quot;, line 3732, in set_yticks
      ret = self.yaxis.set_ticks(ticks, minor=minor)
    File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\axis.py&quot;, line 1755, in set_ticks
      self.set_view_interval(min(ticks), max(ticks))
    File &quot;C:\Users\User\anaconda3\lib\site-packages\matplotlib\axis.py&quot;, line 1892, in setter
      setter(self, min(vmin, vmax, oldmin), max(vmin, vmax, oldmax),
  TypeError: '&lt;' not supported between instances of 'numpy.ndarray' and 'str'
  </code></pre>
  <p><strong>Update 2:</strong> This one works <code>fig = daily_data_f_no_nr.plot(kind='line', figsize=(20, 16), fontsize=26, xticks=daily_data_f_no_nr['Day'], yticks=daily_data_f_no_nr['Total TODO/TODOE count']).get_figure()</code>.</p>