Skip to content

Sort and uniquify style entries in figure options. #5342

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

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Oct 28, 2015

Fixes the first two points of #5341.

@anntzer anntzer force-pushed the sort-and-uniquify-styles-in-figure-options branch 2 times, most recently from 487e517 to 4cab2e7 Compare November 12, 2015 07:19
@anntzer
Copy link
Contributor Author

anntzer commented Nov 12, 2015

Kindly requesting some help here: I honestly can't see what the test failure is due to or how it is related to this PR.

@jenshnielsen
Copy link
Member

The test failure is likely intermittent and not related to your work. I have restarted the test

@anntzer anntzer mentioned this pull request Nov 12, 2015
@mdboom mdboom added this to the proposed next point release (2.1) milestone Nov 12, 2015
@mdboom
Copy link
Member

mdboom commented Nov 12, 2015

Looks like @jenshnielsen was right here. The tests are now passing.

Just played with this and one subtle thing that struck me is that the special values of "None" and "nothing" are now sorted somewhere in the middle (by n obviously) and it might be nice to have those at the top.

markers = list(six.iteritems(MARKERS))

def prepare_data(d, init):
"""Prepare entry for FormLayout.
Copy link
Member

Choose a reason for hiding this comment

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

Can you please document the expected input parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@anntzer
Copy link
Contributor Author

anntzer commented Nov 12, 2015

Just played with this and one subtle thing that struck me is that the special values of "None" and "nothing" are now sorted somewhere in the middle (by n obviously) and it might be nice to have those at the top.

The current behavior is that the multiple entries of None (or none or nothing, depending on whoever PYTHONHASHSEED decided to pick) are randomly scattered across the combobox, so sorting is already an improvemvent.

I could special-case them to the top, but if we go that route we may as well come up with a better order of the markers (such as one that keeps triangles, squares, pentagons and hexagons next to each other and in that order).

@tacaswell
Copy link
Member

The code for uniqueifying the symbols seems too complex/sutble for what it is doing. I think what I proposed in the now folded comment is easier to read/understand.

@anntzer anntzer force-pushed the sort-and-uniquify-styles-in-figure-options branch from babb03e to 2bbffe1 Compare November 13, 2015 01:14
@anntzer
Copy link
Contributor Author

anntzer commented Nov 13, 2015

Perhaps this new version is clearer?

@tacaswell
Copy link
Member

Yes, that is much clearer

@tacaswell
Copy link
Member

@mdboom I think sorting alphabetically makes enough sense here.

@anntzer Sorry, I just sorted out what which way you are de-duplicating the mapping and I was worried over nothing.

tacaswell added a commit that referenced this pull request Nov 24, 2015
…ure-options

ENH: Sort and uniquify style entries in figure options.
@tacaswell tacaswell merged commit c52ef28 into matplotlib:master Nov 24, 2015
@anntzer anntzer deleted the sort-and-uniquify-styles-in-figure-options branch November 24, 2015 05:57
@QuLogic QuLogic modified the milestones: 2.0 (style change major release), 2.1 (next point release) Jul 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants