Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 2 additions & 10 deletions .github/workflows/niceplots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,11 @@ jobs:
- name: Install apt dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: fonts-cmu nodejs npm
packages: nodejs npm
version: 1.0
- name: Install node dependencies
run: |
sudo npm install -g odiff-bin
- name: Install Prompt font
run: |
mkdir Prompt
cd Prompt
wget "https://fonts.google.com/download?family=Prompt" -O Prompt.zip
unzip Prompt.zip
mkdir ~/.fonts
cp *.ttf ~/.fonts
- name: Install python dependencies
run: |
pip install --upgrade pip wheel
Expand All @@ -61,7 +53,7 @@ jobs:
cd examples
bash ImageComparisonTest.sh
- name: Upload examples if failed
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ failure() && matrix.python-version == '3.11' && matrix.numpy-version == '1.26.*' && matrix.mpl-version == '3.8.*' }}
with:
name: Examples
Expand Down
12 changes: 0 additions & 12 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ build:
os: ubuntu-20.04
tools:
python: "3.10"
apt_packages:
- fonts-cmu
# Install the fonts for the james style
jobs:
pre_install:
- mkdir Prompt
- cd Prompt
- wget "https://fonts.google.com/download?family=Prompt" -O Prompt.zip
- unzip Prompt.zip
- mkdir ~/.fonts
- cp *.ttf ~/.fonts
- cd ..

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
35 changes: 4 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,9 @@ pip install niceplots
* Clone this repository, then enter the folder in the command line terminal.
* Enter `pip install -e .` within the `niceplots` folder.

### Font installation (optional)
### Font installation

NicePlots styles use fonts that do not ship with most operating systems, so you'll need to install them separately.
If they are not installed, matplotlib will revert back to its default sans-serif font, DejaVu Sans.

The font used by each style is as follows:
- doumont-light (default niceplots): CMU Bright
- doumont-dark: CMU Bright
- james-dark: Prompt
- james-light: Prompt

Install the fonts on your system and then delete Matplotlib's font cache, which is located in `~/.cache/matplotlib` by default on most operating systems.
Matplotlib will rebuild the font cache next time it is run and (hopefully) find the new fonts.

#### CMU Bright (doumont-light and doumont-dark)

The computer modern bright font can be downloaded from [this link](https://tug.org/FontCatalogue/computermodernbright/).
Alternatively, on Ubuntu, the font can be installed with the following commands:

```
sudo apt-get update
sudo apt-get install fonts-cmu
```
Arch linux users can get the font by installing the `otf-cm-unicode` package from AUR.

#### Prompt (james-dark and james-light)

The Prompt font can be download from [Google Fonts](https://fonts.google.com/specimen/Prompt).
As of v2.6.0, NicePlots now comes packaged with the fonts required for its custom styles, so you don't need to install them yourself.

## How do I get set up?

Expand All @@ -72,10 +47,8 @@ Check the [release notes](https://github.com/mdolab/niceplots/releases/tag/v2.0.

## Contribution guidelines

* Make any changes you see fit. Please fork your own version and submit a pull request.
Make any changes you see fit. Please fork your own version and submit a pull request.

## Who do I talk to?

* Alasdair Gray, alachris@umich.edu
* Eytan Adler, eytana@umich.edu
* Eirikur Jonsson eirikurj@umich.edu
Please post questions and suggestions to either the [issues](https://github.com/mdolab/niceplots/issues) (if it's concerning a bug) or [discussions](https://github.com/mdolab/niceplots/discussions) tab on the NicePlots GitHub repo.
42 changes: 5 additions & 37 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,13 @@
from glob import glob
import shutil
import os
import sys
from sphinx_gallery.scrapers import figure_rst
from pathlib import PurePosixPath


class svgScraper(object):
"""This is a custom scraper for sphinx-gallery that allows us to use the svg files written by our examples. It is
almost entirely copied from the PNGScraper shown at:
https://sphinx-gallery.github.io/dev/advanced.html#example-2-detecting-image-files-on-disk
"""

def __init__(self):
self.seen = set()

def __repr__(self):
return "svgScraper"

def __call__(self, block, block_vars, gallery_conf):
# Find all svg files in the directory of this example.
path_current_example = os.path.dirname(block_vars["src_file"])
svgs = sorted(glob(os.path.join(path_current_example, "*.svg")))

# Get the name of the current example, e.g if the file is called "plot_nested_pie_chart.py",
# then example_name = "nested_pie_chart"
example_name = os.path.splitext(os.path.basename(block_vars["src_file"]))[0].split("plot_")[0]

# Iterate through svgs, copy them to the sphinx-gallery output directory
image_names = list()
image_path_iterator = block_vars["image_path_iterator"]
for svg in svgs:
if svg not in self.seen and example_name.lower() in svg.lower():
self.seen |= set(svg)
this_image_path = image_path_iterator.next()
image_path = PurePosixPath(this_image_path)
image_path = image_path.with_suffix(".svg")
image_names.append(image_path)
shutil.move(svg, image_path)
# Use the `figure_rst` helper function to generate rST for image files
return figure_rst(image_names, gallery_conf["src_dir"])

# This is necessary for sphinx_gallery to be able to import sphinxext.matplotlib_svg_scraper
# (see https://sphinx-gallery.github.io/stable/configuration.html#importing-callables)
sys.path.insert(0, os.path.dirname(__file__))

# -- Project information -----------------------------------------------------
project = "niceplots"
Expand All @@ -50,5 +18,5 @@ def __call__(self, block, block_vars, gallery_conf):
sphinx_gallery_conf = {
"examples_dirs": "../examples", # path to your example scripts
"gallery_dirs": "auto_examples", # path to where to save gallery generated output
"image_scrapers": (svgScraper(),),
"image_scrapers": ("sphinxext.matplotlib_svg_scraper",),
}
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx_mdolab_theme
sphinx-gallery
matplotlib>=3.6
matplotlib>=3.6,<=3.8
8 changes: 8 additions & 0 deletions doc/sphinxext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# For some reason, this is needed to make sphinx gallery use the svg files generated by our examples
# See https://sphinx-gallery.github.io/stable/advanced.html#example-3-matplotlib-with-svg-format for more details

from sphinx_gallery.scrapers import matplotlib_scraper


def matplotlib_svg_scraper(*args, **kwargs):
return matplotlib_scraper(*args, format="svg", **kwargs)
1 change: 1 addition & 0 deletions examples/plot_bar_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
=========
An example of a bar chart.
"""

import matplotlib.pyplot as plt
import niceplots

Expand Down
1 change: 1 addition & 0 deletions examples/plot_nested_pie_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
================
An example of a nested pie chart.
"""

import matplotlib.pyplot as plt
import niceplots

Expand Down
14 changes: 14 additions & 0 deletions niceplots/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
import os
from matplotlib import font_manager

__version__ = "2.5.1"


def addFonts():
font_dirs = [os.path.join(os.path.dirname(__file__), "fonts")]
font_files = font_manager.findSystemFonts(fontpaths=font_dirs)

for font_file in font_files:
font_manager.fontManager.addfont(font_file)


addFonts()

from .utils import *
from .parula import *
93 changes: 93 additions & 0 deletions niceplots/fonts/OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright (c) 2015, Cadson Demak (info@cadsondemak.com)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added niceplots/fonts/Prompt-Black.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-BlackItalic.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-Bold.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-BoldItalic.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-ExtraBold.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-ExtraBoldItalic.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-ExtraLight.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-ExtraLightItalic.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-Italic.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-Light.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-LightItalic.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-Medium.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-MediumItalic.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-Regular.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-SemiBold.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-SemiBoldItalic.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-Thin.ttf
Binary file not shown.
Binary file added niceplots/fonts/Prompt-ThinItalic.ttf
Binary file not shown.
55 changes: 55 additions & 0 deletions niceplots/fonts/SIL Open Font License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Copyright (C) Authors of original metafont fonts:
Donald Ervin Knuth (cm, concrete fonts)
1995, 1996, 1997 J"org Knappen, 1990, 1992 Norbert Schwarz (ec fonts)
1992-2006 A.Khodulev, O.Lapko, A.Berdnikov, V.Volovich (lh fonts)
1997-2005 Claudio Beccari (cb greek fonts)
2002 FUKUI Rei (tipa fonts)
2003-2005 Han The Thanh (Vietnamese fonts)
1996-2005 Walter Schmidt (cmbright fonts)

Copyright (C) 2003-2009, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
with Reserved Font Family Name "Computer Modern Unicode fonts".



This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.

The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the copyright statement(s).

"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.

"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.

5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added niceplots/fonts/cmb10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbsy10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbsy6.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbsy7.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbsy8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbsy9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbx10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbx12.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbx5.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbx6.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbx7.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbx8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbx9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbxsl10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmbxti10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmcsc10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmcsc8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmcsc9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmdunh10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmex10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmex7.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmex8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmex9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmff10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmfi10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmfib8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cminch.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmitt10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmi10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmi12.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmi5.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmi6.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmi7.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmi8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmi9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmib10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmib6.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmib7.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmib8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmmib9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmr10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmr12.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmr17.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmr5.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmr6.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmr7.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmr8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmr9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsl10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsl12.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsl8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsl9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsltt10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmss10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmss12.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmss17.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmss8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmss9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssbx10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssdc10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssi10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssi12.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssi17.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssi8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssi9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssq8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmssqi8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsy10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsy5.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsy6.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsy7.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsy8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmsy9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmtcsc10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmtex10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmtex8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmtex9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmti10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmti12.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmti7.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmti8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmti9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmtt10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmtt12.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmtt8.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmtt9.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmu10.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbi.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbl.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbmo.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbmr.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbso.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbsr.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbtl.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbto.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunbx.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunci.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunit.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunobi.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunobx.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunorm.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunoti.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunrm.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunsi.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunsl.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunso.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunss.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunssdc.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunsx.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmuntb.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunti.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmuntt.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmuntx.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunui.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunvi.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmunvt.ttf
Binary file not shown.
Binary file added niceplots/fonts/cmvtt10.ttf
Binary file not shown.
13 changes: 9 additions & 4 deletions niceplots/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,10 +630,15 @@ def plot_opt_prob(
for conValue in g:
contour = ax.contour(X, Y, conValue, levels=[0.0], colors=colors[colorIndex % nColor])
if conStyle.lower() == "hashed":
plt.setp(
contour.collections,
path_effects=[patheffects.withTickedStroke(angle=60, length=2)],
)
try:
# This works for older versions of matplotlib
plt.setp(
contour.collections,
path_effects=[patheffects.withTickedStroke(angle=60, length=2)],
)
except AttributeError:
# This works for newer versions of matplotlib
contour.set(path_effects=[patheffects.withTickedStroke(angle=60, length=2)])
elif conStyle.lower() == "shaded":
ax.contourf(
X,
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
author_email="",
url="https://github.com/mdolab/niceplots",
license="Apache License, Version 2.0",
packages=[
"niceplots",
],
packages=["niceplots", "niceplots.styles", "niceplots.fonts"],
install_requires=[
"numpy>=1.16",
"matplotlib>=2.2",
"scipy>=1.7",
],
include_package_data=True,
package_data={"": ["styles/*.mplstyle"]},
package_data={"": ["styles/*.mplstyle", "fonts/*.ttf"]},
)