Skip to content

Conversation

@alimuldal
Copy link
Contributor

Hi all,
I just noticed that the styles module currently only looks for user-specified styles in ~/.matplotlib/stylelib. I think it ought to also look in ~/.config/matplotlib/stylelib/ for consistency with ~/.config/matplotlib/matplotlibrc and in order to comply with the latest XDG standard (c.f. #454).

@tacaswell
Copy link
Member

Can you please clean up the PEP8 violations? It looks like you left some trailing white space on one of the lines.

This changes looks reasonable to me, but I suspect that this should have a more correct handling of paths (does '~' work on windows?) like the way rcparams handles the same problem.

I see no reason not to merge this (once pep8 is fixed), but it is a stop-gap.

@alimuldal
Copy link
Contributor Author

'~' is handled by os.path.expanduser - on Windows this will use the HOME and USERPROFILE environment variables if set, or else it will use HOMEPATH and HOMEDRIVE. I don't see any reason why this wouldn't work, but I don't have a Windows machine handy to test it at the moment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better if it just used matplotlib._get_configdir() and then it can be configured in a consistent way. @tonysyu, did you have a motivation for not using that function in the first place, or was it just a case of it being well hidden?

mdboom added a commit that referenced this pull request Jan 13, 2014
Look for user-specified styles in ~/.config/matplotlib/stylelib
@mdboom mdboom merged commit 0722bc3 into matplotlib:master Jan 13, 2014
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

Successfully merging this pull request may close these issues.

4 participants