8000 Setting style defaults for errrobar in rcParams · Issue #8071 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Setting style defaults for errrobar in rcParams #8071

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

Closed
jmccormac01 opened this issue Feb 13, 2017 · 3 comments
Closed

Setting style defaults for errrobar in rcParams #8071

jmccormac01 opened this issue Feb 13, 2017 · 3 comments
Labels
New feature status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action topic: rcparams

Comments

@jmccormac01
Copy link
jmccormac01 commented Feb 13, 2017

I have been trying to write a series of functions that set up default plotting styles for publication quality figures and I noticed something. It is not possible to set the default errorbar settings using rc. The errorbar styling is inherited from the line style (all except the errorbar end cap, which can be set independently). This makes sense if you do not want to plot the error bars differently to the data points. But if you do, it is not possible to explicitly set the defaults without altering the line properties.

For example, if I wish to plot data using black points with thinned lightgrey (de-emphasised) error bars and then over plot a thicker best-fitting line in red, I have to adjust the line parameters to correctly plot the error bar and then revert them back to plot the best fitting line.

I know the errorbar styling can be set in each call to errorbar but for many plots explicitly setting the default errorbar parameters seems cleaner. Another option a colleague suggested was to just wrap up errorbar in a few function.

I thought I'd point this out as some things (e.g. line and boxplot) have a full set of toggles in rc and others (e.g. scatter and errorbar) do not. I think it would be nice for them all to have independently adjustable settings. Of course feel free to ignore this :) Thanks.

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Feb 13, 2017
@jmccormac01
Copy link
Author

Awesome, thanks!

@tacaswell
Copy link
Member

Another option (that I use heavily) is to keep the style in local dictionaries like plot_style and scatter_style and then do ax.plot(x, y, **plot_style) etc. That seems far more elegant than relying on global state.

You can also use rcparam / style context managers to manage the setting/resetting.

This is also related to one of the problem that cycler was written to solve (http://matplotlib.org/cycler/ )

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Sep 24, 2017
@github-actions
Copy link
github-actions bot commented Apr 7, 2023

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Apr 7, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2023
@rcomer rcomer added the status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New feature status: closed as inactive Issues closed by the "Stale" Github Action. Please comment on any you think should still be open. status: inactive Marked by the “Stale” Github Action topic: rcparams
Projects
None yet
Development

No branches or pull requests

3 participants
0