Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scatterplot function #1436

Merged
merged 17 commits into from
May 29, 2018
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
1 change: 1 addition & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Basic plots
.. autosummary::
:toctree: generated

scatterplot
lineplot

.. _categorical_api:
Expand Down
4 changes: 3 additions & 1 deletion doc/releases/v0.9.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
v0.9.0 (Unreleased)
-------------------

- Added the :func:`lineplot` function for representing relationships between numeric ``x`` and ``y`` variables with lines, potentially after conditioning on up to three other variables and semantically mapping those conditions with the color, size, or style of the lines. This function replaces :func:`tsplot`, but with an API that is more consistent with other modern seaborn functions and has both more flexibility (more dimensions of semantic mapping, better handling of dates) and less flexibility (fewer options for visual representing uncertainty). There is considerable new API documentation and there should also be a new tutorial.
- Added the :func:`scatterplot` function for representing the relationship between ``x`` and ``y``, potentially after conditioning on up to three other variables and semantically mapping those conditions with the color, size, or style of the points.

- Added the :func:`lineplot` function for representing relationships between``x`` and ``y`` variables with lines, potentially after conditioning on up to three other variables and semantically mapping those conditions with the color, size, or style of the lines. This function replaces :func:`tsplot`, but with an API that is more consistent with other modern seaborn functions and has both more flexibility (more dimensions of semantic mapping, better handling of dates) and less flexibility (fewer options for visual representing uncertainty). There is considerable new API documentation and a few gallery examples.

- Final removal of the previously-deprecated ``coefplot`` and ``interactplot`` functions.

Expand Down
22 changes: 22 additions & 0 deletions examples/different_scatter_variables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
Scatterplot with categorical and continuous semantics
=====================================================

_thumb: .55, .5

"""
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white")

# Load the example iris dataset
iris = sns.load_dataset("iris")

# Draw a scatter plot while assigning point colors and sizes
# to different variables in the dataset
f, ax = plt.subplots(figsize=(6.5, 6.5))
ax = sns.scatterplot(x="sepal_length", y="sepal_width",
hue="species", size="petal_width",
sizes=(50, 200), alpha=.75,
palette="tab10",
data=iris)
19 changes: 19 additions & 0 deletions examples/scatterplot_sizes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Scatterplot with continuous hues and sizes
==========================================

_thumb: .45, .45

"""

import seaborn as sns
sns.set()

# Load the example iris dataset
planets = sns.load_dataset("planets")

cmap = sns.cubehelix_palette(rot=-.2, as_cmap=True)
ax = sns.scatterplot(x="distance", y="orbital_period",
hue="year", size="mass",
palette=cmap, sizes=(10, 200),
data=planets)
Loading