matplotlib icon indicating copy to clipboard operation
matplotlib copied to clipboard

patheffects.SimpleLineShadow calling non-existent get_foreground method from GraphicsContextBase

Open anijjar opened this issue 1 year ago • 9 comments

resolves #28793 : Replaced nonexistent get_foreground() method with get_rgb()


PR checklist

anijjar avatar Sep 13 '24 01:09 anijjar

@timhoffm Hi. Just wondering what else needs to get done before this fix can get merged.

anijjar avatar Oct 03 '24 04:10 anijjar

Per our merge policy, we need two reviews. So this is waiting for a second core developer to approve.

timhoffm avatar Oct 03 '24 05:10 timhoffm

Are you interested in writing a test? It looks like you have a test script in #28793, and it should be able to be turned into a figure comparison if you compare the path effect with directly plotting a line with the effective settings.

QuLogic avatar Oct 03 '24 06:10 QuLogic

Are you interested in writing a test? It looks like you have a test script in #28793, and it should be able to be turned into a figure comparison if you compare the path effect with directly plotting a line with the effective settings.

Sure, that shouldn't be a problem

anijjar avatar Oct 05 '24 22:10 anijjar

I marked the test as XFail because the '@check_figures_equal()' decorator only works for identical results. Here are screen captures of the diff. test_simpleLineShadow_plot pdf _pdf test_simpleLineShadow_plot pdf _pdf-failed-diff test_simpleLineShadow_plot pdf -expected_pdf

anijjar avatar Oct 21 '24 03:10 anijjar

I don't understand; the point of the test would be to confirm that the shadow is set the way you'd expect it to, and thus have equal figures.

QuLogic avatar Oct 22 '24 00:10 QuLogic

I don't understand; the point of the test would be to confirm that the shadow is set the way you'd expect it to, and thus have equal figures.

I see what you mean. I changed it to plot a line with the alpha value instead for transparency.

anijjar avatar Nov 05 '24 05:11 anijjar

How did this ever work?

tacaswell avatar Jun 05 '25 20:06 tacaswell

Well, there was no test before, so no confirmation that it ever did.

QuLogic avatar Jun 05 '25 20:06 QuLogic