Skip to content
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

added some fixes in order to use the result obtained from mpl._get_configdir() [backport to 1.4.2-doc] #4039

Merged
merged 2 commits into from Feb 2, 2015

Conversation

kikocorreoso
Copy link
Contributor

The docs show the folder ~/.matplotlib/stylelib as the folder to find user defined style sheets but the result from:

import matplotlib as mpl
print(mpl._get_configdir())

indicates that the folder should be:
~/.config/matplotlib/stylelib
(

USER_LIBRARY_PATHS = [os.path.join(mpl._get_configdir(), 'stylelib')]
)

This PR just fix this in the docs (http://matplotlib.org/users/style_sheets.html)

I followed the process of the docs to make this PR but it is the first time so if there is somethiing wrong, please, let me know.

If I am wrong about the PR just discard it and sorry for the noise.

@tacaswell tacaswell added this to the v1.4.3 milestone Jan 25, 2015
@tacaswell
Copy link
Member

Blah, this is a result of our configuration system being too flexible and trying to gracefully move to following XDG. ~/.matplotlib is the old path, ~/.config/matplotlib is the default XDG-complaint path.

The actual path is also controlled by two different ENVs.

The docs should probably be change to

file to ``mpl_configdir/stylelib``.  By default ``mpl_configdir`` should be 
``~/.config/matplotlib``, but you can check where yours is with 
``matplotlib.get_configdir()``, you may need to create this directory.

cc @tonysyu

@tacaswell tacaswell changed the title added some fixes in order to use the result obtained from mpl._get_configdir() added some fixes in order to use the result obtained from mpl._get_configdir() [backport to 1.4.2-doc] Jan 25, 2015
the styles have the same name.
path or URL to the style sheet. Alternatively, if you add your ``<style-name>.mplstyle``
file to ``mpl_configdir/stylelib`, you can reuse your custom style sheet with a call to
``style.use(<style-name>)``. By default ``mpl_configdir`` should be ``~/.config/matplotlib``,
Copy link
Contributor

Choose a reason for hiding this comment

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

On my system (OSX), this is actually ~/.matplotlib. There's probably no general way to explicitly write the path for all system. Maybe just writing <mpl_configdir>/stylelib and telling users how to find <mpl_configdir> would be sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tacaswell @tonysyu
I had checked that on Linux at home.

Now, at work and at a windows7 box I get /.matplotlib so @tonysyu is right. It seems the only way is to use matplotlib.get_configdir().

Thanks.

tacaswell added a commit that referenced this pull request Feb 2, 2015
DOC : better reflect where config folder is in style docs

added some fixes in order to use the result obtained from `mpl._get_configdir()`
@tacaswell tacaswell merged commit 9ae654f into matplotlib:master Feb 2, 2015
tacaswell added a commit that referenced this pull request Feb 2, 2015
DOC : better reflect where config folder is in style docs

added some fixes in order to use the result obtained from `mpl._get_configdir()`
@astrojuanlu astrojuanlu deleted the fix-stylesheets-docs branch December 22, 2016 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants