Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Cannot pickle a plot result if use tight_layout method (plot with datetime objects) #8273

Copy link
Copy link
Closed
@bondarevts

Description

@bondarevts
Issue body actions

Bug report

Bug summary

Cannot pickle a plot result if use tight_layout method on the plot with datetime objects.

Code for reproduction

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)

Actual outcome

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  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

Expected outcome

I expect to have a copy of the plot object.

Matplotlib version

matplotlib v.2.0.0 with Python 3.5.2 installed with conda on linux.

>>> 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)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.