Skip to content

Use new defaults more often in examples #5997

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 8 commits into from
Feb 22, 2016

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Feb 14, 2016

I've been through almost all the examples, and tried to add either the default style, or something similar to it. Or in some cases, change some examples to actually be non-default, since the settings they use are now the new default.

This PR + #5995 should make most of the documentation more consistent.

@QuLogic QuLogic added this to the 2.0 (style change major release) milestone Feb 14, 2016
@tacaswell
Copy link
Member

why RbBu instead of viridis in a couple of places?

@QuLogic
Copy link
Member Author

QuLogic commented Feb 14, 2016

Those plots have -2/2 as limits, so I thought it might fit a bit better, though since the data has no real meaning, I suppose it's just as good either way.

@tacaswell
Copy link
Member

Ah, then using diverging map seems like the right thing to do.

@@ -172,7 +172,7 @@ def stack_hist(ax, stacked_data, sty_cycle, bottoms=None,
hist_func = partial(np.histogram, bins=edges)

# set up style cycles
color_cycle = cycler('facecolor', 'rgbm')
color_cycle = cycler('facecolor', plt.rcParams['axes.prop_cycle'][:4])
Copy link
Member

Choose a reason for hiding this comment

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

This will break if there is more than one key in the default prop_cycle

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, good point; I suppose I'll have to iterate, unless the by_key thing you mentioned in the other comment is released.

Copy link
Member

Choose a reason for hiding this comment

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

I am currently working on sorting out what needs to be done for a cycler release, hopefully I can get this done today :shipit: .

Copy link
Member

Choose a reason for hiding this comment

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

With a new cycler release, we can also fix the key normalization problem
for property cycles via change_key()

On Sun, Feb 14, 2016 at 3:01 PM, Thomas A Caswell notifications@github.com
wrote:

In examples/api/filled_step.py
#5997 (comment):

@@ -172,7 +172,7 @@ def stack_hist(ax, stacked_data, sty_cycle, bottoms=None,
hist_func = partial(np.histogram, bins=edges)

set up style cycles

-color_cycle = cycler('facecolor', 'rgbm')
+color_cycle = cycler('facecolor', plt.rcParams['axes.prop_cycle'][:4])

I am currently working on sorting out what needs to be done for a cycler
release, hopefully I can get this done today [image: :shipit:] .


Reply to this email directly or view it on GitHub
https://github.com/matplotlib/matplotlib/pull/5997/files#r52847857.

@tacaswell
Copy link
Member

I did cycler 0.10.0 last night, I think we can bump the minimum version for 2.x+

The axes props demo is trying to set the grid style to something
non-default, but the default is now solid, so it appears to do nothing.
Similarly, the "thick" lines in the axhspan don't appear so thick any
more now that the default line style is a little thicker.
Otherwise, without the edge lines, it's just a couple of error bars in
the middle of the longer bar.
@QuLogic
Copy link
Member Author

QuLogic commented Feb 18, 2016

Great, looks like a rebase picked up the new version.

tacaswell added a commit that referenced this pull request Feb 22, 2016
Use new defaults more often in examples
@tacaswell tacaswell merged commit 918e80e into matplotlib:v2.x Feb 22, 2016
@QuLogic QuLogic deleted the example-defaults branch February 22, 2016 20:59
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