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

Pickled Figure Loses sharedx Properties #4827

Copy link
Copy link
Closed
@spaceluigi

Description

@spaceluigi
Issue body actions

I am storing pickled Figures for plotting at later time but for some reason the sharedx property keeps getting lost on the 2nd (unpickled) figure. Execute the code below for a quick example. Is there a way to reset the shared x property? There is PR 1312 that talks about a potential unshare_x_axes function but there doesn't really appear to be a setting function either. This may actually be two problems though since the pickle should also maintain the sharedx property.

#!/usr/bin/env python
import cPickle as pickle
import matplotlib.pyplot as plt
import numpy as np

# Simple data to display in various forms
x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x ** 2)

f, axarr = plt.subplots(2, sharex=True)
axarr[0].plot(x, y)
axarr[0].set_title('Sharing X axis')
axarr[1].scatter(x, y)

pickle.dump(f,open('test.pickle','wb'))

new_plot = pickle.load(open('test.pickle','rb'))
new_plot.canvas.draw()

plt.show()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No 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.