Skip to content

DOC: (subjectively) nicer annotated barchart example #9907

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
Dec 1, 2017

Conversation

afvincent
Copy link
Contributor

@afvincent afvincent commented Dec 1, 2017

PR Summary

Here is a PR that:

  1. add the possibility in the demonstrated helper function for choosing a specific side where to put the text annotation to avoid overlapping ot the latter with the errorbar. For sure the logic could be made more robust or generic, but I tried to keep it minimal and yet sufficient to get something that I find significantly less terrible than before.
  2. tries to make both case a bit more symmetric from the code point of view between the women and the men cases (ind - width/2 and ind + width/2 instead of ind and ind + width, etc.)
  3. changes the colors: I agree that it is highly subjective but I find the previous ones quite “old fashion” (but maybe that they were chosen to be gender neutral or another peculiar reason).

I am open to revert part or all of 2. and 3. due to their subjective nature. However, I really think that 1. would help to make this example more attractive for people looking for a way to “simply” annotate bar charts (which seems rather frequent by wandering on the Internet) that is still quite pleasant to the eye.

Original
vanilla

Suggestion
tweaked

PR Checklist

  • Code is PEP 8 compliant
  • Documentation is sphinx and numpydoc compliant <- well, hopefully it is.

@afvincent afvincent added this to the v2.2 milestone Dec 1, 2017
@jklymak jklymak merged commit dbe0502 into matplotlib:master Dec 1, 2017
@jklymak
Copy link
Member

jklymak commented Dec 1, 2017

I've merged because I would be very surpised if anyone thought this version was not an improvement over the last! Thanks!

@afvincent
Copy link
Contributor Author

@jklymak Well sometimes there is a reasonable argument about not changing some of the aesthetic part of the code as it is usually a matter of taste and could lead to a pile of small value commits (IIUC).

And I know that some other devs lean more toward the idea that one example should focus one feature and minimize cosmetick tweaks, in order to make the message clearer. I kind of agree with the general idea but sometimes it leads to quite unpleasant plots on purely aesthetic grounds (due to the historical defaults usually), which I also find sad as those example are often one of the main sources of ideas for end-users.

@jklymak
Copy link
Member

jklymak commented Dec 1, 2017

Sure, and if your code did a bunch of obfuscated or wacky things, I wouldn't have merged it (though I was probably bad to not allow PEP8 to finish - ahem).

@afvincent
Copy link
Contributor Author

FWIW, I checked it locally with pycodestyle IIRC ^^.

@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
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.

3 participants