Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
087f08b
Add setup.cfg for the wheel distribution
wiggin15 Oct 12, 2018
11f9de9
Update dates
mwaskom Jan 18, 2020
adcc3fb
Merge branch 'patch-1' of https://github.com/wiggin15/seaborn into ho…
mwaskom Jan 18, 2020
5e151a4
Catch warnings about deprecated annotation option
mwaskom Jan 18, 2020
b06e985
Remove redundant line that triggers warning
mwaskom Jan 18, 2020
40b2605
Avoid warning in swarmplot
mwaskom Jan 19, 2020
c380dae
Avoid warning from pytest on heatmap doctests
mwaskom Jan 19, 2020
de9f702
Ignore otherwise unavoidable warnings in conftest.ini
mwaskom Jan 19, 2020
7da4f93
Remove old Makefile targets for Stanford website
mwaskom Jan 19, 2020
213a03e
Update table css to not break API page
mwaskom Jan 19, 2020
a48eb0e
Update Python kernel that is hardcoded into notebooks
mwaskom Jan 19, 2020
9958071
Fix thumbnail on gallery page
mwaskom Jan 19, 2020
41a3ab9
Include tests in lint check
mwaskom Jan 19, 2020
4e8ca85
PEP8 on Py27
mwaskom Jan 19, 2020
4777757
Force alphabetical sort of example gallery thumbs
mwaskom Jan 19, 2020
70ad6ed
Add file with pinned versions of doc dependencies
mwaskom Jan 19, 2020
a1c19dd
Add v0.9.1 to release notes page
mwaskom Jan 20, 2020
7648a7c
Add a relplot example to line/scatterplot
mwaskom Jan 20, 2020
7dece14
Add intersphinx links where kwargs are defined
mwaskom Jan 20, 2020
2fec4b3
Update to reflect new example data
mwaskom Jan 20, 2020
cae68ac
New pytest breaks coverage?
mwaskom Jan 20, 2020
210cf9f
Update release notes
mwaskom Jan 21, 2020
e4e89a0
Update install docs to reflect new minimum dependencies
mwaskom Jan 21, 2020
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012-2019, Michael L. Waskom
Copyright (c) 2012-2020, Michael L. Waskom
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ coverage:
pytest --doctest-modules --cov=seaborn --cov-config=.coveragerc seaborn

lint:
flake8 --ignore E121,E123,E126,E226,E24,E704,E741,W503,W504 --exclude seaborn/__init__.py,seaborn/colors/__init__.py,seaborn/cm.py,seaborn/tests,seaborn/external seaborn
flake8 --ignore E121,E123,E126,E226,E24,E704,E741,W503,W504 --exclude seaborn/__init__.py,seaborn/colors/__init__.py,seaborn/cm.py,seaborn/external seaborn
10 changes: 2 additions & 8 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ clean:
-rm -rf tutorial/*_files/
-rm -rf tutorial/*.rst
-rm -rf generated/*
-rm -rf introduction_files/*
-rm introduction.rst

tutorials:
make -C tutorial
Expand Down Expand Up @@ -166,11 +168,3 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

upload:
rsync -azP $(BUILDDIR)/html/ [email protected]:WWW/software/seaborn
@echo "Uploaded to Stanford webspace"

upload-dev:
rsync -azP $(BUILDDIR)/html/ [email protected]:WWW/software/seaborn-dev
@echo "Uploaded to Stanford webspace (development page)"
16 changes: 10 additions & 6 deletions doc/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pre {

code {
color: #49759c !important;
background-color: #ffffff !important;
background-color: transparent; !important;
}

code.descclassname {
Expand Down Expand Up @@ -69,7 +69,7 @@ ul.dropdown-menu {
visibility: hidden;
}

table {
.dataframe table {
/*Uncomment to center tables horizontally*/
/* margin-left: auto; */
/* margin-right: auto; */
Expand All @@ -80,13 +80,13 @@ table {
table-layout: fixed;
}

thead {
.dataframe thead {
border-bottom: 1px solid;
vertical-align: bottom;
}

tr, th, td {
text-align: right;
.dataframe tr, th, td {
text-align: left;
vertical-align: middle;
padding: 0.5em 0.5em;
line-height: normal;
Expand All @@ -95,10 +95,14 @@ tr, th, td {
border: none;
}

th {
.dataframe th {
font-weight: bold;
}

table {
margin-bottom: 20px;
}

tbody tr:nth-child(odd) {
background: #f5f5f5;
}
Expand Down
12 changes: 7 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,10 @@ def setup(app):

# -- Intersphinx ------------------------------------------------

intersphinx_mapping = {'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None),
'matplotlib': ('http://matplotlib.org/', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'statsmodels': ('http://www.statsmodels.org/stable/', None)}
intersphinx_mapping = {
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None),
'matplotlib': ('http://matplotlib.org/', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
'statsmodels': ('http://www.statsmodels.org/stable/', None)
}
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ To see the code or report a bug, please visit the `github repository

* Relational: :ref:`API <relational_api>` | :doc:`Tutorial <tutorial/relational>`
* Categorical: :ref:`API <categorical_api>` | :doc:`Tutorial <tutorial/categorical>`
* Distributions: :ref:`API <distribution_api>` | :doc:`Tutorial <tutorial/distributions>`
* Regressions: :ref:`API <regression_api>` | :doc:`Tutorial <tutorial/regression>`
* Distribution: :ref:`API <distribution_api>` | :doc:`Tutorial <tutorial/distributions>`
* Regression: :ref:`API <regression_api>` | :doc:`Tutorial <tutorial/regression>`
* Multiples: :ref:`API <grid_api>` | :doc:`Tutorial <tutorial/axis_grids>`
* Style: :ref:`API <style_api>` | :doc:`Tutorial <tutorial/aesthetics>`
* Color: :ref:`API <palette_api>` | :doc:`Tutorial <tutorial/color_palettes>`
Expand Down
33 changes: 10 additions & 23 deletions doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,29 @@ Dependencies
Mandatory dependencies
^^^^^^^^^^^^^^^^^^^^^^

- `numpy <http://www.numpy.org/>`__ (>= 1.9.3)
- `numpy <http://www.numpy.org/>`__ (>= 1.10.4)

- `scipy <https://www.scipy.org/>`__ (>= 0.14.0)
- `scipy <https://www.scipy.org/>`__ (>= 0.17.1)

- `matplotlib <https://matplotlib.org>`__ (>= 1.4.3)
- `matplotlib <https://matplotlib.org>`__ (>= 1.5.3)

- `pandas <https://pandas.pydata.org/>`__ (>= 0.15.2)
- `pandas <https://pandas.pydata.org/>`__ (>= 0.17.1)

Recommended dependencies
^^^^^^^^^^^^^^^^^^^^^^^^

- `statsmodels <https://www.statsmodels.org/>`__ (>= 0.5.0)

Testing
~~~~~~~

To test seaborn, run ``make test`` in the root directory of the source
distribution. This runs the unit test suite (using ``pytest``, but many older
tests use ``nose`` asserts). It also runs the example code in function
docstrings to smoke-test a broader and more realistic range of example usage.

The full set of tests requires an internet connection to download the example
datasets (if they haven't been previously cached), but the unit tests should
be possible to run offline.

- `statsmodels <https://www.statsmodels.org/>`__ (>= 0.8.0)

Bugs
~~~~

Please report any bugs you encounter through the github `issue tracker
<https://github.com/mwaskom/seaborn/issues/new>`_. It will be most helpful to
include a reproducible example on one of the example datasets (accessed through
:func:`load_dataset`). It is difficult debug any issues without knowing the
versions of seaborn and matplotlib you are using, as well as what `matplotlib
backend <https://matplotlib.org/faq/usage_faq.html#what-is-a-backend>`__ you
are using to draw the plots, so please include those in your bug report.
include a reproducible example on synthetic data or one of the example datasets
(accessed through :func:`load_dataset`). It is difficult debug any issues
without knowing the versions of seaborn and matplotlib you are using, as well
as what `matplotlib backend
<https://matplotlib.org/faq/usage_faq.html#what-is-a-backend>`__ you are have active, so please include those in your bug report.

.. raw:: html

Expand Down
12 changes: 6 additions & 6 deletions doc/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"cell_type": "raw",
"metadata": {},
"source": [
"Behind the scenes, seaborn uses matplotlib to draw plots. Many tasks can be accomplished with only seaborn functions, but further customization might require using matplotlib directly. This is explained in more detail :ref:`below <intro_plot_customization>`. For interactive work, it's recommended to use a Jupyter/IPython interface in `matplotlib mode <https://ipython.readthedocs.io/en/stable/interactive/plotting.html>`_, or else you'll have to call :ref:`matplotlib.pyplot.show` when you want to see the plot.\n",
"Behind the scenes, seaborn uses matplotlib to draw plots. Many tasks can be accomplished with only seaborn functions, but further customization might require using matplotlib directly. This is explained in more detail :ref:`below <intro_plot_customization>`. For interactive work, it's recommended to use a Jupyter/IPython interface in `matplotlib mode <https://ipython.readthedocs.io/en/stable/interactive/plotting.html>`_, or else you'll have to call :func:`matplotlib.pyplot.show` when you want to see the plot.\n",
"\n",
"2. We apply the default default seaborn theme, scaling, and color palette."
]
Expand Down Expand Up @@ -130,7 +130,7 @@
"cell_type": "raw",
"metadata": {},
"source": [
"Most code in the docs will use the :func:`load_dataset` function to get quick access to an example dataset. There's nothing particularly special about these datasets; they are just pandas dataframes, and we could have loaded them with :ref:`pandas.read_csv` or build them by hand. Many examples use the \"tips\" dataset, which is very boring but quite useful for demonstration. The tips dataset illustrates the \"tidy\" approach to organizing a dataset. You'll get the most out of seaborn if your datasets are organized this way, and it is explained in more detail :ref:`below <intro_tidy_data>`.\n",
"Most code in the docs will use the :func:`load_dataset` function to get quick access to an example dataset. There's nothing particularly special about these datasets; they are just pandas dataframes, and we could have loaded them with :func:`pandas.read_csv` or build them by hand. Many examples use the \"tips\" dataset, which is very boring but quite useful for demonstration. The tips dataset illustrates the \"tidy\" approach to organizing a dataset. You'll get the most out of seaborn if your datasets are organized this way, and it is explained in more detail :ref:`below <intro_tidy_data>`.\n",
"\n",
"4. We draw a faceted scatter plot with multiple semantic variables."
]
Expand Down Expand Up @@ -407,7 +407,7 @@
"source": [
"For figure-specific customization, all seaborn functions accept a number of optional parameters for switching to non-default semantic mappings, such as different colors. (Appropriate use of color is critical for effective data visualization, and seaborn has :ref:`extensive support <palette_tutorial>` for customizing color palettes).\n",
"\n",
"Finally, where there is a direct correspondence with an underlying matplotlib function (like :func:`scatterplot` and ``plt.scatter``), additional keyword arguments will be passed through to the matplotlib layer:"
"Finally, where there is a direct correspondence with an underlying matplotlib function (like :func:`scatterplot` and :meth:`matplotlib.axes.Axes.scatter`), additional keyword arguments will be passed through to the matplotlib layer:"
]
},
{
Expand Down Expand Up @@ -521,9 +521,9 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.6 (seaborn-dev)",
"display_name": "Python 3.6 (seaborn-py37-latest)",
"language": "python",
"name": "seaborn-dev"
"name": "seaborn-py37-latest"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -535,7 +535,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
18 changes: 10 additions & 8 deletions doc/releases/v0.9.1.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

v0.9.1 (Unreleased)
------------------
v0.9.1 (January 2020)
---------------------

This is a minor release, comprising mostly bug fixes and compatibility with dependency updates.
This is a minor release with a number of bug fixes and adaptations to changes in seaborn's dependencies. There are also a number of new features.

This is the final version of seaborn that will support Python 2.7 or 3.5.

New features
~~~~~~~~~~~~

- Added the ``corner`` option to :class:`PairGrid` and :func:`pairplot` to make a grid with only the lower triangle of bivariate axes.
- Added the ``corner`` option to :class:`PairGrid` and :func:`pairplot` to make a grid without the upper triangle of bivariate axes.

- Generalized the idea of "diagonal" axes in :class:`PairGrid` to any axes that share an x and y variable.

Expand All @@ -19,12 +21,14 @@ New features

- Added the ability to pass hierarchical label names to the :class:`FacetGrid` legend, which also fixes a bug in :func:`relplot` when the same label appeared in diffent semantics.

- Added the ability to seed the random number generator for the bootstrap used to define error bars in several plots. Relevant functions now have a ``seed`` parameter, which can take either fixed seed (typically an ``int``) or a numpy random number generator object (either the newer ``numpy.random.Generator`` or the older ``numpy.random.RandomState``).
- Added the ability to seed the random number generator for the bootstrap used to define error bars in several plots. Relevant functions now have a ``seed`` parameter, which can take either fixed seed (typically an ``int``) or a numpy random number generator object (either the newer :class:`numpy.random.Generator` or the older :class:`numpy.random.mtrand.RandomState`).

- Added more control over the arrangement of the elements drawn by :func:`clustermap` with the ``{dendrogram,colors}_ratio`` and ``cbar_pos`` parameters. Additionally, the default scaling with different figure sizes has been improved.

- Added the ``tree_kws`` parameter to :func:`clustermap` to control the properties of the lines in the dendrogram.

- Improved support for grouping observations based on pandas index information in categorical plots.

Bug fixes and adaptations
~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -52,8 +56,6 @@ Bug fixes and adaptations

- Fixed a bug where values would be excluded from categorical plots when only one variable was a pandas ``Series`` with a non-default index.

- Improved support for grouping observations based on pandas index information in categorical plots.

- Fixed a bug when using ``Series`` objects as arguments for ``x_partial`` or ``y_partial`` in :func:`regplot`.

- Fixed a bug when passing a ``norm`` object and using color annotations in :func:`clustermap`.
Expand All @@ -64,7 +66,7 @@ Bug fixes and adaptations

- Fixed a bug when resetting the color code short-hands to the matplotlib default.

- Avoided errors from stricter type checking in upcomming ``numpy`` changes.
- Avoided errors from stricter type checking in upcoming ``numpy`` changes.

- Avoided error/warning in :func:`lineplot` when plotting categoricals with empty levels.

Expand Down
4 changes: 4 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sphinx==2.3.1
sphinx_bootstrap_theme==0.6.5 # Later versions mess up the css somehow
nbconvert
ipykernel
16 changes: 6 additions & 10 deletions doc/sphinxext/gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt # noqa: E402

from matplotlib import image

if six.PY3:
# Python 3 has no execfile
Expand Down Expand Up @@ -138,7 +137,7 @@ def create_thumbnail(infile, thumbfile,
cx=0.5, cy=0.5, border=4):
baseout, extout = op.splitext(thumbfile)

im = image.imread(infile)
im = matplotlib.image.imread(infile)
rows, cols = im.shape[:2]
x0 = int(cx * cols - .5 * width)
y0 = int(cy * rows - .5 * height)
Expand Down Expand Up @@ -178,12 +177,10 @@ def __init__(self, filename, target_dir):

# Only actually run it if the output RST file doesn't
# exist or it was modified less recently than the example
if (not op.exists(outfilename)
or (op.getmtime(outfilename) < op.getmtime(filename))):

file_modified = op.getmtime(outfilename) < op.getmtime(filename)
if not op.exists(outfilename) or file_modified:
self.exec_file()
else:

print("skipping {0}".format(self.filename))

@property
Expand Down Expand Up @@ -326,8 +323,7 @@ def main(app):
target_dir = op.join(app.builder.srcdir, 'examples')
image_dir = op.join(app.builder.srcdir, 'examples/_images')
thumb_dir = op.join(app.builder.srcdir, "example_thumbs")
source_dir = op.abspath(op.join(app.builder.srcdir,
'..', 'examples'))
source_dir = op.abspath(op.join(app.builder.srcdir, '..', 'examples'))
if not op.exists(static_dir):
os.makedirs(static_dir)

Expand All @@ -351,7 +347,7 @@ def main(app):
contents = "\n\n"

# Write individual example files
for filename in glob.glob(op.join(source_dir, "*.py")):
for filename in sorted(glob.glob(op.join(source_dir, "*.py"))):

ex = ExampleGenerator(filename, target_dir)

Expand Down
6 changes: 3 additions & 3 deletions doc/tutorial/aesthetics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.6 (seaborn-dev)",
"display_name": "Python 3.6 (seaborn-py37-latest)",
"language": "python",
"name": "seaborn-dev"
"name": "seaborn-py37-latest"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -417,7 +417,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions doc/tutorial/axis_grids.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
"\n",
"You're not limited to existing matplotlib and seaborn functions when using :class:`FacetGrid`. However, to work properly, any function you use must follow a few rules:\n",
"\n",
"1. It must plot onto the \"currently active\" matplotlib ``Axes``. This will be true of functions in the ``matplotlib.pyplot`` namespace, and you can call ``plt.gca`` to get a reference to the current ``Axes`` if you want to work directly with its methods.\n",
"1. It must plot onto the \"currently active\" matplotlib ``Axes``. This will be true of functions in the ``matplotlib.pyplot`` namespace, and you can call :func:`matplotlib.pyplot.gca` to get a reference to the current ``Axes`` if you want to work directly with its methods.\n",
"2. It must accept the data that it plots in positional arguments. Internally, :class:`FacetGrid` will pass a ``Series`` of data for each of the named positional arguments passed to :meth:`FacetGrid.map`.\n",
"3. It must be able to accept ``color`` and ``label`` keyword arguments, and, ideally, it will do something useful with them. In most cases, it's easiest to catch a generic dictionary of ``**kwargs`` and pass it along to the underlying plotting function.\n",
"\n",
Expand Down Expand Up @@ -347,7 +347,7 @@
"cell_type": "raw",
"metadata": {},
"source": [
"Because ``plt.scatter`` accepts ``color`` and ``label`` keyword arguments and does the right thing with them, we can add a hue facet without any difficulty:"
"Because :func:`matplotlib.pyplot.scatter` accepts ``color`` and ``label`` keyword arguments and does the right thing with them, we can add a hue facet without any difficulty:"
]
},
{
Expand Down Expand Up @@ -384,7 +384,7 @@
"cell_type": "raw",
"metadata": {},
"source": [
"Sometimes, though, you'll want to map a function that doesn't work the way you expect with the ``color`` and ``label`` keyword arguments. In this case, you'll want to explicitly catch them and handle them in the logic of your custom function. For example, this approach will allow use to map ``plt.hexbin``, which otherwise does not play well with the :class:`FacetGrid` API:"
"Sometimes, though, you'll want to map a function that doesn't work the way you expect with the ``color`` and ``label`` keyword arguments. In this case, you'll want to explicitly catch them and handle them in the logic of your custom function. For example, this approach will allow use to map :func:`matplotlib.pyplot.hexbin`, which otherwise does not play well with the :class:`FacetGrid` API:"
]
},
{
Expand Down Expand Up @@ -583,9 +583,9 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.6 (seaborn-dev)",
"display_name": "Python 3.6 (seaborn-py37-latest)",
"language": "python",
"name": "seaborn-dev"
"name": "seaborn-py37-latest"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -597,7 +597,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
Loading