Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path.sketch doesn't apply to PolyCollection #19693

Open
story645 opened this issue Mar 12, 2021 · 2 comments · May be fixed by #25645
Open

path.sketch doesn't apply to PolyCollection #19693

story645 opened this issue Mar 12, 2021 · 2 comments · May be fixed by #25645

Comments

@story645
Copy link
Member

Bug report

Bug summary
PolyCollection lines aren't affected by changes to the path.sketch rcparam, even though patches
are-the docs say that polycollection defaults to patch RC params
image

Code for reproduction

import numpy as np

import matplotlib.collections as mcollections
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from matplotlib import rcParams


rcParams['path.sketch'] = (.5, 25, 20)

fig, (ax1, ax2) = plt.subplots(ncols=2)
f1 = mpatches.Rectangle((.25,.25), .5, .5, facecolor='white', edgecolor='C0', linewidth=2)
ax1.add_patch(f1)

verts = np.array([[[1,-1], [1,1], [2.4, 1.5], [2.4, -.5]],
                 [[-.4,1.5],[-.4,-.5],[1,-1],[1,1]],
                 [[-.4, 1.5], [1, 2],[2.4, 1.5], [1,1]]])
verts2 = verts*.25 + [.3]
p = mcollections.PolyCollection(np.vstack([verts, verts2]), facecolor='white', edgecolor='C0', linewidth=2)
ax2.add_collection(p)

Matplotlib version

  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.3.4
  • Matplotlib backend (print(matplotlib.get_backend())): jupyter inline
@oscargus
Copy link
Contributor

It seems to be an issue with the rendering as p.get_sketch_params() returns the correct value.

@oscargus
Copy link
Contributor

oscargus commented Apr 7, 2023

It also seems to be an issue with the agg-backend. Saving as PDF or SVG gives the correct result.

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

Successfully merging a pull request may close this issue.

2 participants