Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Add support for multiple hatches, edgecolors and linewidths in histograms#28073
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
13 commits Select commitHold shift + click to select a range
1a6ec0f
Add support for multiple hatches, edgecolor and linewidth in histograms
Impaler3430e52daa
Add hatch, linewidth and edgecolor parameters to multihist example
Impaler34334df06a
Add test for added parameters
Impaler3434fcb709
Reduced to 13 tests in total
Impaler343347ce22
Added color semantics test and modified vectorized parameters test
Impaler343d7ffeaa
Added None patch test
Impaler3439024be4
Heading edit
Impaler3433bfca5f
Simplified test
Impaler3436029e32
Updated none patch test
Impaler3430349e7d
Made None patch condition explicit
Impaler343d1a8079
Made suggested changes
Impaler3439a813f4
Added version-added directive
Impaler34343ce57d
Made suggested changes
Impaler343File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Add hatch, linewidth and edgecolor parameters to multihist example
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit0e52daad459d0f3b1f1238016533ebf4583a3438
There are no files selected for viewing
13 changes: 9 additions & 4 deletionsgalleries/examples/statistics/histogram_multihist.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -27,19 +27,24 @@ | ||
fig, ((ax0, ax1), (ax2, ax3)) = plt.subplots(nrows=2, ncols=2) | ||
colors = ['red', 'tan', 'lime'] | ||
ax0.hist(x, n_bins, density=True, histtype='bar', color=colors, | ||
label=colors, hatch=['o', '*', '.'], | ||
edgecolor=['black', 'red', 'blue'], linewidth=[1, 2, 3]) | ||
ax0.legend(prop={'size': 10}) | ||
ax0.set_title('bars with legend') | ||
Impaler343 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
ax1.hist( | ||
x, n_bins, density=True, histtype="bar", stacked=True, | ||
edgecolor=["black", "yellow", "blue"]) | ||
ax1.set_title('stacked bar') | ||
ax2.hist(x, n_bins, histtype='step', stacked=True, fill=False, | ||
linewidth=[1, 2, 3]) | ||
ax2.set_title('stack step (unfilled)') | ||
# Make a multiple-histogram of data-sets with different length. | ||
x_multi = [np.random.randn(n) for n in [10000, 5000, 2000]] | ||
ax3.hist(x_multi, n_bins, histtype='bar', hatch=['\\', '/', '-']) | ||
ax3.set_title('different sample sizes') | ||
fig.tight_layout() | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.