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
14 changes: 13 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ProPlot v1.0.0 (2020-##-##)
This will be published when some major refactoring tasks are completed.
See :pr:`45`, :pr:`46`, and :pr:`50`.

ProPlot v0.4.0 (2020-01-##)
ProPlot v0.4.0 (2020-##-##)
===========================
.. rubric:: Deprecated

Expand Down Expand Up @@ -60,6 +60,18 @@ ProPlot v0.4.0 (2020-01-##)
with a default ``.proplotrc`` file, change the auto-generated user ``.proplotrc``
(:pr:`50`).

ProPlot v0.3.2 (2020-##-##)
===========================
.. rubric:: Bug fixes

- Fix `~proplot.rctools.rc_configurator.context` bug (:issue:`80` and :pr:`91`).
- Improvements to fonts API.

.. rubric:: Documentation

- Imperative mood for docstring summaries (:pr:`92`).


ProPlot v0.3.1 (2019-12-16)
===========================
.. rubric:: Bug fixes
Expand Down
4 changes: 3 additions & 1 deletion docs/_templates/breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
Name class btn-neutral so it inherits properties of other RTD buttons
-->
{% block breadcrumbs %}
<!--
<div class="admonition note">
<p><a href="https://github.com/lukelbd">ProPlot author here</a>: Due to my day job as a graduate student, further development may be restricted to bugfixes until the summer of 2020. In the meantime, if you are interested in contributing to ProPlot, please see the <a href="https://proplot.readthedocs.io/en/latest/contributions.html">contribution guide</a>. Any amount of help is welcome!
<p><a href="https://github.com/lukelbd">ProPlot author here</a>: Due to my day job as a graduate student, certain <a href="https://github.com/lukelbd/proplot/pulls?q=is%3Aopen+is%3Apr">feature additions</a> may be delayed to the summer of 2020. In the meantime, if you are interested in contributing to ProPlot, please see the <a href="https://proplot.readthedocs.io/en/latest/contributions.html">contribution guide</a>. Any amount of help is welcome!
</p>
</div>
-->
<li id="lightdark-li">
<label for="lightdark-checkbox" id="lightdark-label">
<input type="checkbox" id="lightdark-checkbox"/>
Expand Down
52 changes: 44 additions & 8 deletions docs/colors_fonts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"raw_mimetype": "text/restructuredtext"
},
"source": [
"ProPlot registers several new color names and font families. These are described below."
"ProPlot registers several new color names and font families, and includes tools for defining your own color names and adding your own font families. These features are described below."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Included color names"
"## Included colors"
]
},
{
Expand Down Expand Up @@ -48,7 +48,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Drawing from cmaps and cycles"
"## Colors from colormaps"
]
},
{
Expand All @@ -57,7 +57,7 @@
"raw_mimetype": "text/restructuredtext"
},
"source": [
"If you want to draw an individual color from a smooth colormap or a color cycle, use ``color=(cmap, coord)`` or ``color=(cycle, index)`` with any command that accepts the `color` keyword. The ``coord`` should be between ``0`` and ``1``, while the ``index`` is the index on the list of cycle colors. This feature is powered by the `~proplot.styletools.ColorDict` class. This is useful if you spot a nice color in one of the available colormaps and want to use it for some arbitrary plot element."
"If you want to draw an individual color from a colormap or a color cycle, use ``color=(cmap, coord)`` or ``color=(cycle, index)`` with any command that accepts the `color` keyword. The ``coord`` should be between ``0`` and ``1``, while the ``index`` is the index on the list of cycle colors. This feature is powered by the `~proplot.styletools.ColorDict` class. This is useful if you spot a nice color in one of the available colormaps and want to use it for some arbitrary plot element."
]
},
{
Expand Down Expand Up @@ -97,7 +97,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Included font names"
"## Using your own colors"
]
},
{
Expand All @@ -106,9 +106,25 @@
"raw_mimetype": "text/restructuredtext"
},
"source": [
"ProPlot adds several open source sans-serif fonts, introduces a `~proplot.styletools.show_fonts` command to display the available sans-serif fonts on your system, and tries to make the default font *Helvetica Neue*, *Helvetica*, or *Arial* if they are installed. Generally speaking, simple, clean sans-serif fonts are more appropriate for figures than serif fonts.\n",
"You can register your own colors by adding ``.txt`` files to the ``~/.proplot/colors`` directory and calling `~proplot.styletools.register_colors`. This command is also called on import. Each file should contain lines that look like ``color: #xxyyzz`` where ``color`` is the registered color name and ``#xxyyzz`` is the HEX color value."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Included fonts"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"ProPlot adds several open source sans-serif fonts and introduces a `~proplot.styletools.show_fonts` command to display the available sans-serif fonts on your system (see `~matplotlib.font_manager`). Generally speaking, simple, clean sans-serif fonts are more appropriate for figures than serif fonts.\n",
"\n",
"You can register your own fonts by adding ``.ttf`` and ``.otf`` files to the ``~/.proplot/fonts`` directory and calling `~proplot.styletools.register_fonts` (which is also called on import). To change the default font, use the `~proplot.rctools.rc` object or modify your ``~/.proplotrc``. See :ref:`Configuring proplot` for details."
"ProPlot also changes the default font to the Helvetica-lookalike TeX Gyre Heros. Matplotlib uses DejaVu Sans by default because DejaVu Sans is open source, can be *included* in the matplotlib distribution, and includes glyphs for a wider range of mathematical characters (where you see the \"¤\" dummy symbol in the below table, that character is unavailable). However Helvetica and Arial are much more mature and (in this developer's humble opinion) aesthetically pleasing. Thus, while ProPlot prioritizes aesthetics, you may need to switch to a font with more math characters like DejaVu Sans or Fira Math."
]
},
{
Expand All @@ -118,7 +134,27 @@
"outputs": [],
"source": [
"import proplot as plot\n",
"f = plot.show_fonts()"
"f = plot.show_fonts('DejaVu Sans', 'Fira Math', 'Helvetica', 'TeX Gyre Heros')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Using your own fonts"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
"You can register your own fonts by adding files to the ``~/.proplot/fonts`` directory and calling `~proplot.styletools.register_fonts`. This command is also called on import. To change the default font, use the `~proplot.rctools.rc` object or modify your ``~/.proplotrc``.See :ref:`Configuring proplot` for details.\n",
"\n",
"Sometimes the font you would like to use *is* installed, but the font file is not stored under the matplotlib-compatible ``.ttf``, ``.otf``, or ``.afm`` formats. For example, several macOS fonts are unavailable because they are stored as ``.dfont`` collections. Also, while matplotlib nominally supports ``.ttc`` collections, ProPlot manually removes them because figures with ``.ttc`` fonts `cannot be saved as PDFs <https://github.com/matplotlib/matplotlib/issues/3135>`__. You can get matplotlib to use these fonts by expanding the \"collections\" into individual ``.ttf`` files with the `DFontSplitter application <https://peter.upfold.org.uk/projects/dfontsplitter>`__, then saving the files in-place or in the ``~/.proplot/fonts`` folder.\n",
"\n",
"To find font files, check the paths listed in ``OSXFontDirectories``, ``X11FontDirectories``, ``MSUserFontDirectories``, and ``MSFontDirectories`` under the `~matplotlib.font_manager` module. Note that if the font in question has a \"thin\" style, implied by file names with the word ``Thin``, `a matplotlib bug <https://github.com/matplotlib/matplotlib/issues/8788>`__ may cause these styles to override the \"normal\" style!"
]
}
],
Expand Down
4 changes: 3 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
ProPlot
=======

A comprehensive, easy-to-use `matplotlib <https://matplotlib.org/>`__ wrapper for making beautiful, publication-quality graphics. The Github page is `here <https://github.com/lukelbd/proplot>`__.
A comprehensive, easy-to-use `matplotlib <https://matplotlib.org/>`__ wrapper for making beautiful, publication-quality graphics. This project is published `on GitHub <https://github.com/lukelbd/proplot>`__.

Please note that due to my day job as a graduate student, `certain feature additions <https://github.com/lukelbd/proplot/pulls?q=is%3Aopen+is%3Apr>`__ will be delayed to the summer of 2020. In the meantime, if you are interested in contributing to ProPlot, please see the :ref:`Contribution guide`. Any amount of help is welcome!

.. toctree::
:maxdepth: 1
Expand Down
12 changes: 0 additions & 12 deletions docs/why.rst
Original file line number Diff line number Diff line change
Expand Up @@ -516,18 +516,6 @@ ipython session, simply call
`~proplot.styletools.register_cycles`, and
`~proplot.styletools.register_fonts`.

ProPlot also changes the default font to Helvetica or Arial if they are
available (see `~proplot.rctools.use_font`).
Matplotlib uses DejaVu Sans by default because
DejaVu Sans is open source and can be *included* in the matplotlib distribution.
However Helvetica and Arial are much more mature, respected,
and (in this developer's humble opinion)
aesthetically pleasing. Thus, ProPlot trades aesthetics for consistency --
the default font now depends on your machine.
The examples on this website use DejaVu Sans
because Helvetica and Arial are both unavailable on
the `RTD server <https://readthedocs.org>`__.

..
As mentioned above,
ProPlot introduces the `~proplot.styletools.Colormap` and `~proplot.styletools.Cycle`.
Expand Down
2 changes: 1 addition & 1 deletion proplot/.proplotrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ coast: False
color: k
cycle: colorblind
facecolor: w
fontname: auto
fontname: "sans-serif"
geogrid: True
grid: True
gridminor: False
Expand Down
Binary file added proplot/fonts/FiraMath-Bold.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-Book.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-ExtraBold.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-ExtraLight.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-Heavy.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-Light.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-Medium.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-Regular.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-SemiBold.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-Ultra.ttf
Binary file not shown.
Binary file added proplot/fonts/FiraMath-UltraLight.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-Bold.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-Bold.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-BoldItalic.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-BoldItalic.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-Book.otf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-BookItalic.otf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-ExtraBold.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-ExtraBold.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-ExtraBoldItalic.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-ExtraBoldItalic.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-ExtraLight.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-ExtraLight.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-ExtraLightItalic.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-ExtraLightItalic.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-Heavy.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-Heavy.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-HeavyItalic.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-HeavyItalic.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-Italic.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-Italic.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-Light.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-Light.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-LightItalic.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-LightItalic.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-Medium.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-Medium.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-MediumItalic.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-MediumItalic.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-Regular.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-Regular.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-SemiBold.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-SemiBold.ttf
Binary file not shown.
Binary file removed proplot/fonts/FiraSans-SemiBoldItalic.otf
Binary file not shown.
Binary file added proplot/fonts/FiraSans-SemiBoldItalic.ttf
Binary file not shown.
29 changes: 29 additions & 0 deletions proplot/fonts/LICENSE-TEXGYREHEROS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
This is a preliminary version (2006-09-30), barring acceptance from
the LaTeX Project Team and other feedback, of the GUST Font License.
(GUST is the Polish TeX Users Group, http://www.gust.org.pl)

For the most recent version of this license see
http://www.gust.org.pl/fonts/licenses/GUST-FONT-LICENSE.txt
or
http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt

This work may be distributed and/or modified under the conditions
of the LaTeX Project Public License, either version 1.3c of this
license or (at your option) any later version.

Please also observe the following clause:
1) it is requested, but not legally required, that derived works be
distributed only after changing the names of the fonts comprising this
work and given in an accompanying "manifest", and that the
files comprising the Work, as listed in the manifest, also be given
new names. Any exceptions to this request are also given in the
manifest.

We recommend the manifest be given in a separate file named
MANIFEST-<fontid>.txt, where <fontid> is some unique identification
of the font family. If a separate "readme" file accompanies the Work,
we recommend a name of the form README-<fontid>.txt.

The latest version of the LaTeX Project Public License is in
http://www.latex-project.org/lppl.txt and version 1.3c or later
is part of all distributions of LaTeX version 2006/05/20 or later.
92 changes: 92 additions & 0 deletions proplot/fonts/LICENSE_FIRAMATH.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Copyright (C) 2018, 2019 by Xiangdong Zeng <xdzeng96@gmail.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:
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 AND 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 proplot/fonts/texgyreheros-bold.ttf
Binary file not shown.
Binary file added proplot/fonts/texgyreheros-bolditalic.ttf
Binary file not shown.
Binary file added proplot/fonts/texgyreheros-italic.ttf
Binary file not shown.
Binary file added proplot/fonts/texgyreheros-regular.ttf
Binary file not shown.
Loading