Installation

Easy Way

  1. Install clearplot using pip install -v clearplot from the command line.
    1. This will download clearplot from PyPI, install it on your PYTHONPATH, and install the custom fonts in the proper directory. The -v tells pip to be verbose, so you can see what pip is doing.
    2. If pip has trouble connecting to the PyPI server, you can download clearplot from PyPI’s website and run pip install -v [path], where [path] is the path to the downloaded tarball.

Hard (Manual) Way

  1. Get a recent copy of clearplot using git clone https://github.com/breedlun/clearplot.
  2. Append the clearplot directory to your PYTHONPATH.
  3. Load a python interpreter. Verify that you can run import clearplot without any errors.
  4. Place the custom fonts where matplotlib can find them.
    1. Find where Matplotlib stores its True Type fonts. In a python interpreter, type the following two commands: import matplotlib, matplotlib.matplotlib_fname(). On a mac, you should get something like .../site-packages/matplotlib/mpl-data/matplotlibrc. The True Type fonts are stored in .../site-packages/matplotlib/mpl-data/fonts/ttf/.
    2. Grab the fonts in the directories inside clearplot/Font_Files/ and place them in: .../python3.8/site-packages/matplotlib/mpl-data/fonts/ttf/.
    3. Find where Matplotlib stores its cache files. In a python interpreter, enter matplotlib.get_cachedir(). On a mac, you should get something like /Users/[username]/.matplotlib.
    4. Go to /Users/[username]/.matplotlib and delete fontList.cache. Next time matplotlib is imported the cache file will be rebuilt.
    5. If you run into trouble, or want more information, see this post.

Optional Additional Steps

  1. If you are using the Spyder IDE on a Mac, you may need to change the matplotlib backend loaded by Spyder’s scientific startup script. The MacOSX backend and the TkAgg backend both have issues (see this post and this post for more information). If you are running into these problems, you must:
  1. Go to Spyder Preferences->Console->External Modules and set the GUI Backend to Qt4Agg.
  2. Go to Spyder Preferences->Console->Advanced Settings and select “Use the following startup script” to select the scientific_startup.py script.
  3. Restart Spyder.
  1. Install the custom fonts on your system so they can be accessed by other applications like Adobe Illustrator and Inkscape.
    1. Find where Matplotlib stores its True Type fonts. In a python interpreter, type the following two commands: import matplotlib, matplotlib.matplotlib_fname(). On a mac you should get something like: .../site-packages/matplotlib/mpl-data/matplotlibrc. The custom fonts, such as TeXGyreHeros-txfonts, should have been installed in .../site-packages/matplotlib/mpl-data/fonts/ttf/.
  1. For Adobe Illustrator on a Mac, you can simply open the Font Book application (/Applications/Utilities/Font Book) and “drag and drop” the font files into the Font Book window.
  2. For Inkscape on a Mac, you must copy the font files into the main font folder, not the user font folder. The main font folder is located at /Library/Fonts.
  3. I do not know how to install fonts on Windows or Linux, but I am sure there are instructions online.