Skip to content
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

Histogram with histtype='step' dows not respect lines.linewidth #4065

Closed
maxnoe opened this issue Feb 5, 2015 · 7 comments
Closed

Histogram with histtype='step' dows not respect lines.linewidth #4065

maxnoe opened this issue Feb 5, 2015 · 7 comments

Comments

@maxnoe
Copy link
Contributor

maxnoe commented Feb 5, 2015

hist with histtype=step ignores the lines.linewidth rcParam.

@tacaswell
Copy link
Member

This is because hist use a Patch object to draw the stepped histogram, not a Line2D object.

I would suggest not using hist and instead use np.histogram + ax.step

vals, bins = np.histogram(..)
ax.step(bins[:-1], vals, where='post')

which should be aware of that rcparam.

@maxnoe
Copy link
Contributor Author

maxnoe commented Feb 6, 2015

Ah ok. So it does respect patch.linewidth.

@anntzer
Copy link
Contributor

anntzer commented Sep 17, 2015

I would like to suggest switching to using ax.step internally to plot such histograms, so that lines.linewidth gets respected (I think it makes sense e.g. for seaborn to set a relatively small patch.linewidth but a large lines.linewidth).

@tacaswell
Copy link
Member

@anntzer No, because then the return typo of hist would depend on a kwarg which is really bad form.

@anntzer
Copy link
Contributor

anntzer commented Sep 17, 2015

Fair enough, reopened on seaborn's side as mwaskom/seaborn#704.

@anntzer
Copy link
Contributor

anntzer commented Oct 8, 2015

Reporting an idea that had been shot down on seaborn's side:
What about having hist locally patch rcParams to set patch.linewidth to lines.linewidth when making the plot? I still think the current behavior is unintuitive.

@tacaswell
Copy link
Member

👎 on that from me as well.

If something like that were to happen, the right place would be for seaborn to wrap hist and then use the style context manager to locally over-ride the rcparams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants