Skip to content

FIX: cast Patch linewidth to float for dash scaling #30333

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

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Jul 18, 2025

PR summary

Fixes #30323. The code from #30323 (comment) now produces

image

For now I have not added a test - as noted at #30323 (comment)

The obvious test (set linewidth with a string) would represent a use-case that seems controversial amongst the maintainers, so I am not sure if we want that in there.

PR checklist

@story645 story645 added this to the v3.10.4 milestone Jul 18, 2025
@story645
Copy link
Member

test failures seem unrelated, feel free to merge after they're all run (assuming failures stay unrelated) & thanks!

@rcomer rcomer merged commit efacc7d into matplotlib:main Jul 18, 2025
36 of 39 checks passed
@rcomer rcomer deleted the conpatch-lw branch July 18, 2025 19:54
Copy link

lumberbot-app bot commented Jul 18, 2025

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.10.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 efacc7d26c2d378deb097349bd4051ed4bd29032
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #30333: FIX: cast Patch linewidth to float for dash scaling'
  1. Push to a named branch:
git push YOURFORK v3.10.x:auto-backport-of-pr-30333-on-v3.10.x
  1. Create a PR against branch v3.10.x, I would have named this PR:

"Backport PR #30333 on branch v3.10.x (FIX: cast Patch linewidth to float for dash scaling)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@rcomer
Copy link
Member Author

rcomer commented Jul 18, 2025

Conflict seems to be because the next line is wrapped on the bugfix branch

self._dash_pattern = mlines._scale_dashes(
*self._unscaled_dash_pattern, w)

I'm not convinced this is worth a manual backport.

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

Successfully merging this pull request may close these issues.

[MNT]: validate linewidth
3 participants