Fix set_fillstyle dropping marker transform#31296
Conversation
Line2D.set_fillstyle() was creating a new MarkerStyle with only the marker symbol and fillstyle, discarding any user-supplied transform, capstyle, or joinstyle from the existing marker. This caused markers with rotation transforms to lose their rotation when the fillstyle was changed. Now passes through the existing marker's user transform, capstyle, and joinstyle when constructing the replacement MarkerStyle. Closes matplotlib#31257
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. You can also join us on gitter for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
|
This account is opening a lot of PRs in a short space of time so I assume they are automated. Closing the PR and blocking the account for a week per our policy |
Summary
Line2D.set_fillstyle()was constructing a newMarkerStylewith only the marker symbol and the new fillstyle, throwing away the user-suppliedtransform,capstyle, andjoinstylefrom the existing marker. This meant that markers with rotation transforms lost their rotation when the fillstyle was updated after plotting.The fix passes through the existing marker's user transform, capstyle, and joinstyle to the replacement
MarkerStyle.Closes #31257
Test
Added
test_set_fillstyle_preserves_marker_transformintest_lines.pythat sets a rotation transform on a marker, changes the fillstyle, and asserts the transform is still present.