Bug in circle patch plotting when using the same patch for two different figures · Issue #3776 · matplotlib/matplotlib · GitHub
Skip to content

Bug in circle patch plotting when using the same patch for two different figures #3776

Description

@astrofrog

The following code:

import numpy as np

import matplotlib.pyplot as plt
from matplotlib.patches import Circle

image = np.random.random((10,10))
c = Circle((5., 5.), 3.)

fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.imshow(image, interpolation='nearest', vmin=-2., vmax=3.)
ax.add_patch(c)
fig.savefig('nearest.png')

fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.imshow(image, vmin=-2., vmax=3.)
ax.add_patch(c)
fig.savefig('default.png')

produces the following two figures:

nearest.png [looks correct]

nearest

default.png [definitely doesn't look correct]

default

This is with the latest developer version of Matplotlib with Python 3.4.

[cc @cdeil @bsipocz @larrybradley - this is the issue that is causing https://github.com/astropy/photutils/pull/114#issuecomment-48383187]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: changesChanges to the public API, typically requiring deprecation.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions