LaTeX LaTeX, which is pronounced «Lah-tech» or «Lay-tech», is a document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents but it can be used for almost any form of publishing. Install your RubyGems with gem and their dependencies with brew. “To install, drag this icon” no more. Homebrew Cask installs macOS apps, fonts and plugins and other non-open source software. $ brew install-cask firefox. Making a cask is as simple as creating a formula.
LaTeX, which is pronounced «Lah-tech» or «Lay-tech», is a document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents but it can be used for almost any form of publishing.
Installation
When installing LaTex, two following options are given to users:
- Install MacTeX with builtin editor (TexLive) - (3.2GB)
- Install BasicTeX only (100MB) + your personal LaTeX editor
MacTeX vs BasicTeX
MacTeX includes additional programs such as an editor and a BibTeX reference manager that help users to work with TeX outside of the command line. BasicTeX does not include these GUI programs. The trade-off that comes with using BasicTeX is that you will have to download and install additional packages and programs as the need arises- and BasicTeX is so basic that the need will arise. So, after installing BasicTeX you will be faced with the tasks of installing additional programs and installing missing packages.
MacTex
Download MacTex, or use brew install --cask mactex
.You can read more about MacTex in What is installed (pdf).
Since MacTex installs a LaTex editor (TexMaker) already, installing another LaTeX editor is unnecessary.
BasicTeX
Download BasicTeX, or use brew install --cask basictex
. You can read more about BasicTex in BasicTeX (pdf).
You may use tlmgr
to install tools/packages that you need.
Note: You may find CLI tool tlmgr
cumbersome to use, in that case install GUI for tlmgr
- TeX Live Utility - brew install --cask tex-live-utility
.
Now you should pick a LaTeX editor, here are some to choose from:
Note: You may want to use a PDF reader that watches your PDF files, like Skim (can be installed by brew install --cask skim
and Sync feature can be enabled in Preferences -> Sync).
Released:
Format Matplotlib for scientific plotting
Brew Latexmk
Project description
Matplotlib styles for scientific plotting
This repo has Matplotlib styles to format your plots for scientific papers, presentations and theses.
Getting Started
The easiest way to install SciencePlots is using pip
:
The pip installation will automatically move all of the *.mplstyle
files into the appropriate directory. Please see the FAQ for more information and troubleshooting.
Installing Latex
The SciencePlots package also 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, I recommend MikTex. Again, you have to add Latex to your path enviroment variable. See this issue for more troubleshooting tips.
On Linux (Ubuntu), you can install Tex Live and the other requirements using:
Please see Matplotlib's guide to using Latex for more troubleshooting tips.
Using the Styles
science.mplstyle
is the main style from this repo. Whenever you want to use it, simply add the following to the top of your python script:
You can also combine multiple styles together by:
In this case, the ieee
style will override some of the parameters from the science
style in order to configure the plot for IEEE papers (column width, fontsizes, etc.).
To use any of the styles temporarily, you can use:
Examples
The science
style:
The science
+ grid
styles:
The science
+ ieee
styles for IEEE papers:
- IEEE requires figures to be readable when printed in black and white. The
ieee
style also sets the figure width to fit within one column of an IEEE paper.
The science
+ scatter
styles for scatter plots:
Brew Latexit
The science
+ notebook
styles for Jupyter notebooks:
Latex2html Brew
You can also combine these styles with the other styles that come with Matplotlib. For example, the dark_background
+ science
+ high-vis
styles:
Note: See the examples/
directory for more!
CJK Fonts
Traditional Chinese (science
+ no-latex
+ cjk-tc-font
):
Simplified Chinese (science
+ no-latex
+ cjk-sc-font
):
Japanese (science
+ no-latex
+ cjk-jp-font
):
Korean (science
+ no-latex
+ cjk-kr-font
):
See the FAQ for information on installing CJK fonts.
Color Blind Safe Color Cycles
Git-latexdiff Brew
The bright
color cycle (7 colors):
The vibrant
color cycle (7 colors):
The muted
color cycle (10 colors):
The high-contrast
color cycle (3 colors):
The light
color cycle (9 colors):
Note: These color cycles are from Paul Tol's website.
Other Color Cycles
The high-vis
color cycle:
The retro
color cycle:
Help and Contributing
Please feel free to contribute to the SciencePlots repo! For example, it would be good to add new styles for different journals and add new color cycles. Before starting a new style or making any changes, please create an issue through the GitHub issue tracker. That way we can discuss if the changes are necessary and the best approach.
If you need any help with SciencePlots, please first check the FAQ and search through the previous GitHub issues. If you can't find an answer, create a new issue through the GitHub issue tracker.
You can checkout Matplotlib's documentation for more information on plotting settings.
FAQ
Errors related to Latex:
If you get an error saying
RuntimeError: Failed to process string with tex because latex could not be found
, this means that you do not have Latex installed on your computer (or at least Python can't find it). You have three options: (1) install Latex, (2) fix the path to Latex, or (3) disable Latex using theno-latex
option:See 'Installing Latex' for more information.
Manual installation:
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: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):
Using different fonts:
SciencePlots uses the default serif font. If you would like to specify a different font, you can use:
If you would like to use Times New Roman specifically, please see the discussion in this issue.
Using CJK fonts:
To use CJK 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:
Note that
matplotlib
may not find the fonts correctly. You can refresh the font cache by running:You should use the parameter
backend='pgf'
for thesavefig()
to use XeLaTeX instead of PdfLaTeX (this LaTeX engine doesn't work with CJK fonts properly). Besides, it can't export thejpg
format when you use the parameterbackend='pgf'
for thesavefig()
.See this issue for more information.
Installing SciencePlots within Google Colab, IPython, Jupyter Notebooks, etc.:
After installing SciencePlots within one of these environments, you may need to reload the Matplotlib style library. For example:
SciencePlots in Academic Papers
The following papers use SciencePlots
:
Jegannathan, G., et al., 'Current-Assisted SPAD with Improved p-n Junction and Enhanced NIR Performance', Sensors, Dec 2020. (open access)
H. Tian, et al., 'ivis Dimensionality Reduction Framework for Biomacromolecular Simulations', J. Chem. Inf. Model., Aug 2020. (open access)
P. Stoltz, et al., 'A new simple algorithm for space charge limited emission,'Phys. Plasmas, vol. 27, no. 9, pp. 093103, Sep. 2020. (open access)
J. Garrett, et al., 'A Nonlinear Transmission Line Model for Simulating Distributed SIS Frequency Multipliers,'IEEE Trans. THz Sci. Technol., vol. 10, no. 3, pp. 246-255, May 2020. (open access)
J. Garrett, et al., 'Simulating the Behavior of a 230 GHz SIS Mixer Using Multi-Tone Spectral Domain Analysis,'IEEE Trans. THz Sci. Technol., vol. 9, no. 9, pp. 540-548, Nov. 2019. (open access)
J. Garrett, et al., 'A Compact and Easy to Fabricate E-plane Waveguide Bend,'IEEE Microw. Wireless Compon. Lett., vol. 29, no. 8, pp. 529-531, Aug. 2019. (open access)
J. Garrett, 'A 230 GHz Focal Plane Array Using a Wide IF Bandwidth SIS Receiver,' DPhil thesis, University of Oxford, Oxford, UK, 2018. (open access)
If you use SciencePlots
in your paper/thesis, feel free to add it to the list!
Citing SciencePlots
You don't have to cite SciencePlots if you use it, but it's nice if you do:
Release historyRelease notifications | RSS feed
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size SciencePlots-1.0.7.tar.gz (10.4 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for SciencePlots-1.0.7.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | cf2a8985372c33e4499909ab36547dc5042fd276a278f69d851c1e4ce7a936b4 |
MD5 | 073a1e2c446cfdbef3b3ce051fd82aaa |
BLAKE2-256 | bd72c491390b5c3a68eec6895ff2c1cf8cb87d8659bf4b824684aecc6bf63fc0 |