-
Notifications
You must be signed in to change notification settings - Fork 711
FAQ
-
SciencePlots requires Latex to be installed on your machine.
-
On MacOS, I recommend MacTex. Make sure that this Latex installation is added to your path enviroment variable. See this issue for more troubleshooting tips.
-
On Windows, we recommend TexLive. Previously, MikTex was recommended Issue#117. In any case, check Latex is in your path environment variable by running the
latex
command. See this issue for more troubleshooting tips. -
On Linux (Ubuntu), you can install Tex Live and the other requirements using:
sudo apt-get install dvipng texlive-latex-extra texlive-fonts-recommended cm-super
-
-
Please see Matplotlib's guide to using Latex for more troubleshooting tips.
-
If you don't want to install Latex, you can disable Latex by using:
plt.style.use(['science','no-latex'])
CJK font styles have been deprecated in favour of other packages that maintain it actively. For example, make use
mplfonts
See issue#84.Till we get some more info, we will preserve this wiki section.
-
To use Chinese, Japanese or Korean fonts, you first need to install Noto CJK Fonts. You can download and install these fonts from the given link or you can install them with a package manager:
# Ubuntu / Debian sudo apt update sudo apt install fonts-noto-cjk # macOS brew tap homebrew/cask-fonts brew cask install font-noto-serif-cjk-tc brew cask install font-noto-serif-cjk-sc brew cask install font-noto-serif-cjk-jp brew cask install font-noto-serif-cjk-kr # archlinux sudo pacman -S noto-fonts-cjk
-
For Windows Subsystem for Linux (WSL), you will need to manually download and install the fonts by following these instructions.
-
Note that
matplotlib
may not find the fonts correctly. You can refresh the font cache by running:Warning: this was deprecated in matplotlib 3.4.0, see issue#84
import matplotlib.font_manager as fm fm._rebuild()
-
See this issue for more information.
-
If you like, you can install the
*.mplstyle
files manually. First, clone the repository and then copy all of the*.mplstyle
files into your Matplotlib style directory. If you're not sure where this is, in an interactive python console type:import matplotlib import scienceplots print(matplotlib.get_configdir())
-
You should get back something like
/home/garrett/.matplotlib
. You would then put the*.mplstyle
files in/home/garrett/.matplotlib/stylelib/
(you may need to create thestylelib
directory):cp styles/*.mplstyle ~/.matplotlib/stylelib/ && cp styles/*/*.mplstyle ~/.matplotlib/stylelib/
-
SciencePlots uses the default serif font. If you would like to specify a different font, you can use:
import matplotlib.pyplot as plt import scienceplots plt.style.use('science') plt.rcParams.update({ "font.family": "serif", # specify font family here "font.serif": ["Times"], # specify font here "font.size":11}) # specify font size here
-
If you would like to use Times New Roman specifically, please see the discussion in this issue.
After version 2.0.0
, using SciencePlots is the same as explained above.
SciencePlots
: Matplotlib styles for scientific figures