8000 added some fixes in order to use the result obtained from `mpl._get_configdir()` [backport to 1.4.2-doc] by kikocorreoso · Pull Request #4039 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doc/users/style_sheets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Defining your own style
=======================

You can create custom styles and use them by calling ``style.use`` with the
path or URL to the style sheet. Alternatively, if you add your
``<style-name>.mplstyle`` file to ``~/.matplotlib/stylelib`` (you may need to
create this directory), you can reuse your custom style sheet with a call to
``style.use(<style-name>)``. Note that a custom style sheet in
``~/.matplotlib/stylelib`` will override a style sheet defined by matplotlib if
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.

7477

@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.

but you can check where yours is with ``matplotlib.get_configdir()``, you may need to
create this directory. Note that a custom style sheet in ``mpl_configdir/stylelib``
will override a style sheet defined by matplotlib if the styles have the same name.

For example, you might want to create
``~/.matplotlib/stylelib/presentation.mplstyle`` with the following::
``mpl_configdir/stylelib/presentation.mplstyle`` with the following::

axes.titlesize : 24
axes.labelsize : 20
Expand Down
0