Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Look for user-specified styles in ~/.config/matplotlib/stylelib#2720

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mdboom merged 4 commits intomatplotlib:masterfromalimuldal:styles_XDG_compliance
Jan 13, 2014

Conversation

alimuldal
Copy link
Contributor

Hi all,
I just noticed that thestyles 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 thelatest 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
ContributorAuthor

'~' is handled byos.path.expanduser - on Windows this will use theHOME andUSERPROFILE environment variables if set, or else it will useHOMEPATH andHOMEDRIVE. 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.

@@ -30,7 +30,8 @@
_here = os.path.abspath(os.path.dirname(__file__))
BASE_LIBRARY_PATH = os.path.join(_here, 'stylelib')
# Users may want multiple library paths, so store a list of paths.
USER_LIBRARY_PATHS = [os.path.join('~', '.matplotlib', 'stylelib')]
USER_LIBRARY_PATHS = [os.path.join('~', '.matplotlib', 'stylelib'),
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 usedmatplotlib._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 requestJan 13, 2014
Look for user-specified styles in ~/.config/matplotlib/stylelib
@mdboommdboom merged commit0722bc3 intomatplotlib:masterJan 13, 2014
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v1.4.0
Development

Successfully merging this pull request may close these issues.

4 participants
@alimuldal@tacaswell@pelson@mdboom

[8]ページ先頭

©2009-2025 Movatter.jp