Skip to content

Error in Agg backend's PNG renderer when markeredgewidth > markersize #16621

Closed as not planned
@brunobeltran

Description

@brunobeltran

Bug report

Bug summary

Whenever the edge width of a marker is increased beyond the size of the marker, you would want the marker to

Code for reproduction

import matplotlib.pyplot as plt
for i in range(0, 150, 20):
    fig, ax = plt.subplots()
    lines = ax.plot(0, 0, marker='p', markersize=60, markeredgewidth=i, 
                    markeredgecolor='k', clip_on=False)
    plt.xlim([-0.04, 0.04])
    plt.ylim([-0.04, 0.04])
    plt.savefig(f'/home/bbeltr1/Downloads/test_{i}.png')
fig._cachedRenderer

Actual outcome

While the outer extents of the pentagon's edge appear correct, you can see that the inner extents begin to recede away from the center as the edge width is set larger and larger, until eventually the original marker is fully visible again, along with some of the background.

Console output:
<matplotlib.backends.backend_agg.RendererAgg at 0x7f5277bf0e80>

Saved images:
test_0
test_20
test_40
test_60
test_80
test_100
test_120
test_140

Expected outcome

The expected outcome is a fully-shaded pentagon (due to the edge being huge). My PDF backend does this correctly, as seen below in a screenshot of what test_140.pdf looks like if I save as 'test_{i}.pdf' instead:

test_140 pdf

Matplotlib version

  • Operating system: Debian 9
  • Matplotlib version: 3.1.3
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline is what gets printed, and inline plots also show this error, but I can take Jupyter out of the loop by saving directly to file. Both cases are apparently using RendererAgg to make the PNG, as seen above.
  • Python version: 3.7.3
  • Jupyter version (if applicable):
  • Other libraries:

Matplotlib was installed and updated via the default conda channel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend: aggstatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions