-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Document that rcparam values are unquoted #3670
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
What do you mean by 'not work' . Typically questions like this should go to the user mailing list (matplotlib-users@lists.sourceforge.net you have to sign up for the list to have posting rights) or stackoverflow.com . |
By "not working" I mean, that once I test these settings by trying to plot a scatter plot, I get an error message: |
And what version of mpl are you using? |
In [1]: import matplotlib |
Thanks for reporting this, this actually is a substantial bug. For some reason, when reading from the file it is growing quotes:
|
Your welcome. Thanks for the quick response. |
@kfiz Actually, I am way over-reacting. The problem is that, contrary to all python expectations, the values in the .matplotlibrc file go in unquoted. The correct line is
I have changed your issue title to (in my view) more accurately describe the problem. |
Hmm. Well specifying ".", results in "o" not ".", on my machine. |
That is because plot() doesn't use that parameter to determine the default By the way, single quotes are perfectly valid and are used elsewhere in the Ben Root On Sat, Oct 18, 2014 at 12:26 PM, kfiz notifications@github.com wrote:
|
Ok, if these settings don't apply to plot, scatter and such, then this obviously explains the behaviour I observed. I agree, one should state clearly, to what types of plots/graphics the settings in matplotlibrc apply. |
In [2]: plt.plot(range(15))
Out[4]: [<matplotlib.lines.Line2D at 0x7fcd86258790>] with
in my matplolibrc file. The default is read in https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/lines.py#L296 |
Sigh... Gotta love how many levels deep we evaluate these rcParams! |
I would argue that the deeper the better with these. |
Now I'm really confused. |
Sorry, checked again. The above example works on my machine. Had a typo in matplotlibrc. |
There are no quotes in the rcparams and stylesheet docs, so can this issue be closed? |
It's a bit more complicated than that. There are occasional cases of quotes such as in the cycler specification and all of the animation parameters. I suspect we are stuck with relying on the examples, as you suggest; we can't just add a line somewhere saying "don't put quotes around values in the matplotlibrc file" because there are exceptions. |
Hi @story645 |
Sorry, go ahead, totally forgot to follow up. Also what do you mean by machine shop? |
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! |
So uh finally got back to this, and I think it may make more sense to ensure that all the validation functions try to support quoted enteries rather than to document which ones do and don't. That's because, as of now, we have about 47 functions (give or take parameterizations and listifyers) for about 317 rcParams. If there's support, I'd like to repurpose the RcParams project to track work checking each function & follow up prs to add support as needed. Basically I'm thinking the work involved is:
|
Discussed on call and @ksunden pointed out that the everything string approach would create ambiguity for colors, and @QuLogic mentioned @chahak13's work may help in building a directive to improve documentation. The conclusion was that one path forward is to allow '' for the subset of validation functions that take strings where allowing quotes would not create ambiguity. Particularly allowing for quotes in the following should handle most use cases:
|
On a side-note: These are the burdens of having a custom file format. Any type-aware format (YAML, TOML, python files, ...) would defer these complications to the format specification/parser and set clear expectations for the user. It would in principle not be difficult do migrate to another format. The major obstacle will be argee on one of them). |
I went through all the trouble of #26854 & the like six PRs it spawned to avoid Python files 😭 |
As I already suggested elsewhere, another possibility would be to keep supporting |
While unambiguous in definition, I'm afraid that'd be still a major source of confusion - users typically don't use this often and it's hard to remember whether it was I have a strong preference for any standard format. That way we get rid of all parsing complications, and users don't have to learn a custom syntax. |
Hi,
I'm not able to specify the default marker in matplotlibrc.
I tried:
lines.marker : '.'
lines.marker : 'point'
and others. Nothing worked.
What's the right way to do it?
Sry for asking this on the bug tracker, but I didn't now where else to ask.
Cheers
The text was updated successfully, but these errors were encountered: