<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">Cannot pickle a plot result if use <code class="notranslate">tight_layout</code> method on the plot with datetime objects.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
import pickle
from datetime import datetime

plot = plt.plot([datetime(1900, 1, 1), datetime(1900, 1, 2)], [1, 2])
plt.gcf().tight_layout()

dump = pickle.dumps(plot)
pickle.loads(dump)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-k">import</span> <span class="pl-s1">pickle</span>
<span class="pl-k">from</span> <span class="pl-s1">datetime</span> <span class="pl-k">import</span> <span class="pl-s1">datetime</span>

<span class="pl-s1">plot</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-en">datetime</span>(<span class="pl-c1">1900</span>, <span class="pl-c1">1</span>, <span class="pl-c1">1</span>), <span class="pl-en">datetime</span>(<span class="pl-c1">1900</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>)], [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">gcf</span>().<span class="pl-en">tight_layout</span>()

<span class="pl-s1">dump</span> <span class="pl-c1">=</span> <span class="pl-s1">pickle</span>.<span class="pl-en">dumps</span>(<span class="pl-s1">plot</span>)
<span class="pl-s1">pickle</span>.<span class="pl-en">loads</span>(<span class="pl-s1">dump</span>)</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/Users/user/miniconda3/lib/python3.5/site-packages/matplotlib/dates.py&quot;, line 719, in __getattr__
    return getattr(self._rrule, name)

 ...

  File &quot;/Users/user/miniconda3/lib/python3.5/site-packages/matplotlib/dates.py&quot;, line 719, in __getattr__
    return getattr(self._rrule, name)
RecursionError: maximum recursion depth exceeded while calling a Python object"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/Users/user/miniconda3/lib/python3.5/site-packages/matplotlib/dates.py", line 719, in __getattr__
    return getattr(self._rrule, name)

 ...

  File "/Users/user/miniconda3/lib/python3.5/site-packages/matplotlib/dates.py", line 719, in __getattr__
    return getattr(self._rrule, name)
RecursionError: maximum recursion depth exceeded while calling a Python object
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">I expect to have a copy of the <code class="notranslate">plot</code> object.</p>
<p dir="auto"><strong>Matplotlib version</strong></p>
<p dir="auto">matplotlib v.2.0.0 with Python 3.5.2 installed with conda on linux.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import sys; print(sys.version)
3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import sys; print(sys.version)
3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]
</code></pre></div>
<p dir="auto">To help us understand and resolve your issue, please fill out the form to the best of your ability. You can feel free to delete the sections that do not apply.</p>
<h3 dir="auto">Bug report</h3>
<ul dir="auto">
<li>A short 1-2 sentences that succinctly describes the bug</li>
</ul>
<p dir="auto">get function of multiprocessing.AsyncResult fails in case of plotting pandas.DataFrame with using non-UTC DatetimeIndex</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<ul dir="auto">
<li>A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from multiprocessing.pool import Pool
import pandas as pd
from matplotlib import pyplot as plt

def func(df):
    fig, ax = plt.subplots()
    df.plot(ax=ax)
    return 'title', fig

if __name__ == '__main__':
    index = pd.DatetimeIndex(pd.date_range('2016-10-05', periods=10, freq='T', tz='UTC'))
    index = index.tz_convert('America/Chicago')
    df = pd.DataFrame(list(range(10)), index=index, columns=['a'])
    with Pool(3) as pool:
        proc = pool.apply_async(func, (df,))
        title, fig = proc.get()
        fig.savefig(r'.\test.png')"><pre class="notranslate"><code class="notranslate">from multiprocessing.pool import Pool
import pandas as pd
from matplotlib import pyplot as plt

def func(df):
    fig, ax = plt.subplots()
    df.plot(ax=ax)
    return 'title', fig

if __name__ == '__main__':
    index = pd.DatetimeIndex(pd.date_range('2016-10-05', periods=10, freq='T', tz='UTC'))
    index = index.tz_convert('America/Chicago')
    df = pd.DataFrame(list(range(10)), index=index, columns=['a'])
    with Pool(3) as pool:
        proc = pool.apply_async(func, (df,))
        title, fig = proc.get()
        fig.savefig(r'.\test.png')
</code></pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<ul dir="auto">
<li>The output produced by the above code, which may be a screenshot, console output, etc.</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;C:\miniconda\envs\p3\lib\threading.py&quot;, line 914, in _bootstrap_inner
    self.run()
  File &quot;C:\miniconda\envs\p3\lib\threading.py&quot;, line 862, in run
    self._target(*self._args, **self._kwargs)
  File &quot;C:\miniconda\envs\p3\lib\multiprocessing\pool.py&quot;, line 429, in _handle_results
    task = get()
  File &quot;C:\miniconda\envs\p3\lib\multiprocessing\connection.py&quot;, line 251, in recv
    return ForkingPickler.loads(buf.getbuffer())
  File &quot;C:\miniconda\envs\p3\lib\site-packages\matplotlib\dates.py&quot;, line 730, in __getattr__
    return getattr(self._rrule, name)

  ...

  File &quot;C:\miniconda\envs\p3\lib\site-packages\matplotlib\dates.py&quot;, line 730, in __getattr__
    return getattr(self._rrule, name)
RecursionError: maximum recursion depth exceeded"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "C:\miniconda\envs\p3\lib\threading.py", line 914, in _bootstrap_inner
    self.run()
  File "C:\miniconda\envs\p3\lib\threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "C:\miniconda\envs\p3\lib\multiprocessing\pool.py", line 429, in _handle_results
    task = get()
  File "C:\miniconda\envs\p3\lib\multiprocessing\connection.py", line 251, in recv
    return ForkingPickler.loads(buf.getbuffer())
  File "C:\miniconda\envs\p3\lib\site-packages\matplotlib\dates.py", line 730, in __getattr__
    return getattr(self._rrule, name)

  ...

  File "C:\miniconda\envs\p3\lib\site-packages\matplotlib\dates.py", line 730, in __getattr__
    return getattr(self._rrule, name)
RecursionError: maximum recursion depth exceeded
</code></pre></div>
<p dir="auto"><strong>Expected outcome</strong></p>
<ul dir="auto">
<li>A description of the expected outcome from the code snippet</li>
<li>If this used to work in an earlier version of Matplotlib, please note the version it used to work on</li>
</ul>
<p dir="auto">it should save a valid figure to the test.png</p>
<p dir="auto"><strong>Matplotlib version</strong></p>
<ul dir="auto">
<li>Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)</li>
<li>How did you install Matplotlib and Python (pip, anaconda, from source ...)</li>
</ul>
<p dir="auto">Matplotlib version:</p>
<blockquote>
<blockquote>
<blockquote>
<p dir="auto">matplotlib.<strong>version</strong><br>
'1.5.3'</p>
</blockquote>
</blockquote>
</blockquote>
<p dir="auto">Python version:<br>
Python 3.5.2</p>
<p dir="auto">Platform:<br>
Windows</p>
<p dir="auto">installed using mini-conda like:<br>
conda install matplotlib</p>