Skip to content

MarkerStyle is considered immutable #19341

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
Jan 28, 2021

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jan 22, 2021

PR Summary

as discussed in yesterdays dev call.

See also #17850 (comment).

@timhoffm timhoffm added this to the v3.4.0 milestone Jan 22, 2021
@timhoffm timhoffm force-pushed the immutable-marker branch 7 times, most recently from 475462a to d27ab97 Compare January 22, 2021 23:13
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall makes sense to me, but it seems lines.set_fillstyle is not tested? Or did you want to deprecate that as well?

@@ -534,7 +534,7 @@ def set_fillstyle(self, fs):

For examples see :ref:`marker_fill_styles`.
"""
self._marker.set_fillstyle(fs)
self.set_marker(MarkerStyle(self._marker.get_marker(), fs))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we never test set_fillstyle? Can we use this as the opportunity to do so?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have this deprecation be part of 3.4 and I don't know if I have the bandwidth to add tests soon. Therefore, I'd rather do this in a later PR.

@timhoffm
Copy link
Member Author

timhoffm commented Jan 25, 2021

As opposed to what I said in the dev call, we cannot easily deprecate Lines.set/get_fillstyle. I thought get_marker() would return the MarkerStyle so that we could do line.get_marker().get_fillstyle(). However, the used MarkerStyle object is not public. get_marker() does not return it but only the marker symbol, e.g. 'o'.

Therefore, I'll leave marker and fillstyle as "simple" Matplotlib properties of Line2D for now.

@jklymak jklymak merged commit 476b7e4 into matplotlib:master Jan 28, 2021
@timhoffm timhoffm deleted the immutable-marker branch January 28, 2021 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants