X Tutup
Skip to content

Pyplot.savefig is very slow with some combinations of data/ylim scales #5918

@soupault

Description

@soupault

Hi!

I've found this quite strange behaviour where savefig hangs:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt


df_data = pd.DataFrame(np.random.rand(20, 1), columns=['a'])

fig, axes = plt.subplots()

axes.errorbar(
    df_data.index,
    df_data['a'],
    color='CadetBlue', marker='d')

# Hangs
# axes.vlines(8.5, 0, 1e6, colors='Silver', linestyles='dashed')
# axes.set_ylim((0, 1))

# Works
# axes.vlines(8.5, 0, 1e3, colors='Silver', linestyles='dashed')
# axes.set_ylim((0, 1))

# Works
# axes.vlines(8.5, 0, 1e6, colors='Silver', linestyles='dashed')
# axes.set_ylim((0, 1e1))

print('check A')
plt.savefig('test_image')
print('check B')
plt.close()

Software versions:
Windows 7 x64 (will test on Linux later);
Python 3.4.4 (conda);
matplotlib 1.5.1 (from C.Gohlke website).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    X Tutup