matplotlib icon indicating copy to clipboard operation
matplotlib copied to clipboard

Enables setting hatch linewidth in Patches and Collections, also fixes setting hatch linewidth by rcParams

Open Impaler343 opened this issue 1 year ago • 10 comments

PR summary

Fixes #21108 using the patch provided by @anntzer which I modified to pass tests. Need to write tests for:

  • [x] Setting hatch linewidth in a Patch
  • [x] Setting hatch linewidth in a Collection

PR checklist

Impaler343 avatar Apr 09 '24 07:04 Impaler343

I don't know why docs and CI are failing, could somebody please check this out?

Impaler343 avatar Apr 10 '24 02:04 Impaler343

Hi @Impaler343, I'm not certain but I think the docs failure may be related to something that has been fixed on main. Could you try rebasing?

git fetch upstream
git rebase upstream/main

Appveyor is showing the same failure on all PRs right now, so I wouldn't worry about that one.

rcomer avatar Apr 10 '24 10:04 rcomer

Do I also need to squash?

Impaler343 avatar Apr 10 '24 17:04 Impaler343

There is enough exploration/experimentation in here it is probably worth squashing to a handful of commits.

tacaswell avatar Apr 10 '24 21:04 tacaswell

I think this is like 80% of the way there and looking pretty good!

tacaswell avatar Apr 10 '24 21:04 tacaswell

Can we get a feature for check_figures_equal() similar to image_comparison()'s remove_text feature? As the former is a more economical way to test, having it for check_figures_equal() would be a good idea. Or is it already available, and I don't see it?

Impaler343 avatar Apr 11 '24 12:04 Impaler343

Can we get a feature for check_figures_equal() similar to image_comparison()'s remove_text feature?

I do not think this is required? The reason remove_text exists is that the font files may be different on different machine. However, check_figures_equal() are executed on the same machine, so should never be a problem. Am I missing something?

oscargus avatar Apr 15 '24 12:04 oscargus

Can we get a feature for check_figures_equal() similar to image_comparison()'s remove_text feature?

I do not think this is required? The reason remove_text exists is that the font files may be different on different machine. However, check_figures_equal() are executed on the same machine, so should never be a problem. Am I missing something?

I suggested this as it is a quick plugin to make tests run faster by focussing on the important part of the plot, by removing axes, labels and ticks, and this most probably should make a significant difference while running a large amount of tests

Impaler343 avatar Apr 15 '24 13:04 Impaler343

Have removed the if conditions as they are unreachable:

  • hatchstyle cannot be None as a non-None value of hatch is passed in the function hatch_cmd before being called.

On another note, a lot of lines in backend_bases is uncovered, and I don't think I can write tests for all of them. What to do?

Impaler343 avatar Jun 06 '24 12:06 Impaler343

Anything else to add or change?

Impaler343 avatar Jul 04 '24 07:07 Impaler343

I think the doc build failure is unrelated; you may have to rebase/merge to fix it.

QuLogic avatar Oct 23 '24 18:10 QuLogic