-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
About linestyles: tuple not accepted in rc param file and other inconsistencies #11797
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
Comments
Many cases (not all) were fixed by #15827. |
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! |
To move forward or close this, it would be good to recreate the initial tables on what works and what not with the current version of matplotlib. I'm marking this as good first issue for recreating the tables. Further actions will need to be discussed on the result. |
Good first issue - notes for new contributorsThis issue is suited to new contributors because it does not require understanding of the We do not assign issues. Check the Development section in the sidebar for linked pull If something is unclear, please reach out on any of our communication |
As good first issue: It would be good to recreate the initial tables on what works and what not with the current version of matplotlib. |
I thought @oscargus looked into this wrt dashes and linestyles? |
This is related to #8040 and #9797, possibly #7219.
Bug report
Apart from strings like
"-"
,"--"
,":"
, the linestyle can also be set as a tuple of an on/off sequence. There are however two different notations,(on, off, on, off, ...)
and(start, (on, off, on, off, ...))
.For all of the ways to set the linestyle, only one or none of those actually work.
Most importantly there is currently no way to set an on/off linestyle via the rc file.
The following lists those combinations and whether they work or not with the respective commands.
linestyle /dashes inside plot function
plt.plot([1,2], linestyle=":")
plt.plot([1,2], linestyle=(5,1,1,1))
plt.plot([1,2], linestyle=(0,(5,1,1,1)))
plt.plot([1,2], dashes=":")
plt.plot([1,2], dashes=(5,1,1,1))
plt.plot([1,2], dashes=(0, (5,1,1,1)))
using rcParams
plt.rcParams["grid.linestyle"] = ":"
plt.rcParams["grid.linestyle"] = (5,1,1,1)
plt.rcParams["grid.linestyle"] = (0,(5,1,1,1))
inside cycler using rcParams
plt.rcParams["axes.prop_cycle"] += plt.cycler("linestyle", [":"])
plt.rcParams["axes.prop_cycle"] += plt.cycler("linestyle", [(5,1,1,1)])
plt.rcParams["axes.prop_cycle"] += plt.cycler("linestyle", [(0,(5,1,1,1))])
using rc file
grid.linestyle : :
grid.linestyle : (5,1,1,1)
grid.linestyle : (0,(5,1,1,1))
inside cycler using rc file
axes.prop_cycle : cycler("linestyle", [":"] )
axes.prop_cycle : cycler("linestyle", [(5,1,1,1)] )
axes.prop_cycle : cycler("linestyle", [(0,(5,1,1,1))] )
Correlation
":"
(5,1,1,1)
(0,(5,1,1,1))
plt.plot(..., linestyle=x)
plt.plot(..., dashes=x)
plt.rcParams["grid.linestyle"] = x
plt.rcParams["axes.prop_cycle"] += plt.cycler("linestyle", [x])
grid.linestyle : x
axes.prop_cycle : cycler("linestyle", [x] )
I think the first thing to do here is to identify which combinations should actually work.
attn. @afvincent who has last worked on validation of linestyle rc Parameters.
The text was updated successfully, but these errors were encountered: