Skip to content

Commit

Permalink
More tweaks to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Jun 30, 2018
1 parent 000030f commit 8d72578
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 32 deletions.
12 changes: 6 additions & 6 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ API reference

.. _basic_api:

Basic plots
-----------
Relational plots
----------------

.. autosummary::
:toctree: generated
Expand All @@ -24,6 +24,7 @@ Categorical plots
.. autosummary::
:toctree: generated/

factorplot
stripplot
swarmplot
boxplot
Expand All @@ -41,6 +42,8 @@ Distribution plots
.. autosummary::
:toctree: generated/

jointplot
pairplot
distplot
kdeplot
rugplot
Expand All @@ -53,6 +56,7 @@ Regression plots
.. autosummary::
:toctree: generated/

lmplot
regplot
residplot

Expand All @@ -76,12 +80,8 @@ Multi-plot grids
:toctree: generated/

FacetGrid
factorplot
lmplot
PairGrid
pairplot
JointGrid
jointplot

.. _style_api:

Expand Down
16 changes: 8 additions & 8 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ seaborn: statistical data visualization
<div style="clear: both"></div>
<div class="container-fluid hidden-xs hidden-sm">
<div class="row">
<a href="examples/different_scatter_variables.html">
<a href="examples/scatterplot_matrix.html">
<div class="col-md-2 thumbnail">
<img src="_static/different_scatter_variables_thumb.png">
<img src="_static/scatterplot_matrix_thumb.png">
</div>
</a>
<a href="examples/errorband_lineplots.html">
<div class="col-md-2 thumbnail">
<img src="_static/errorband_lineplots_thumb.png">
</div>
</a>
<a href="examples/scatterplot_matrix.html">
<a href="examples/different_scatter_variables.html">
<div class="col-md-2 thumbnail">
<img src="_static/scatterplot_matrix_thumb.png">
<img src="_static/different_scatter_variables_thumb.png">
</div>
</a>
<a href="examples/horizontal_boxplot.html">
Expand Down Expand Up @@ -109,11 +109,11 @@ To see the code or report a bug, please visit the `github repository
</div>
<div class="panel-body">

* Basic: :ref:`API <basic_api>` | :ref:`Tutorial <basic_tutorial>`
* Relational: :ref:`API <basic_api>` | :ref:`Tutorial <basic_tutorial>`
* Categorical: :ref:`API <categorical_api>` | :ref:`Tutorial <categorical_tutorial>`
* Distribution: :ref:`API <distribution_api>` | :ref:`Tutorial <distribution_tutorial>`
* Regression: :ref:`API <regression_api>` | :ref:`Tutorial <regression_tutorial>`
* Multi-plot: :ref:`API <grid_api>` | :ref:`Tutorial <grid_tutorial>`
* Distributions: :ref:`API <distribution_api>` | :ref:`Tutorial <distribution_tutorial>`
* Regressions: :ref:`API <regression_api>` | :ref:`Tutorial <regression_tutorial>`
* Multiples: :ref:`API <grid_api>` | :ref:`Tutorial <grid_tutorial>`
* Style: :ref:`API <style_api>` | :ref:`Tutorial <aesthetics_tutorial>`
* Color: :ref:`API <palette_api>` | :ref:`Tutorial <palette_tutorial>`

Expand Down
22 changes: 13 additions & 9 deletions examples/different_scatter_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@
Scatterplot with categorical and numerical semantics
====================================================
_thumb: .55, .5
_thumb: .45, .5
"""
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white", palette="muted")
sns.set(style="whitegrid")

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

# Draw a scatter plot while assigning point colors and sizes
# to different variables in the dataset
# 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, 250), alpha=.75,
data=iris)
sns.despine(f, left=True, bottom=True)
clarity_ranking = ["I1", "SI2", "SI1", "VS2", "VS1", "VVS2", "VVS1", "IF"]
sns.scatterplot(x="carat", y="price",
hue="clarity", size="depth",
palette="ch:r=-.2,d=.3_r",
hue_order=clarity_ranking,
sizes=(1, 8), linewidth=0,
data=diamonds, ax=ax)
2 changes: 1 addition & 1 deletion examples/errorband_lineplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Timeseries plot with error bands
================================
_thumb: .5, .45
_thumb: .48, .45
"""
import seaborn as sns
Expand Down
10 changes: 7 additions & 3 deletions examples/grouped_boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
Grouped boxplots
================
_thumb: .66, .45
"""
import seaborn as sns
sns.set(style="ticks")
sns.set(style="ticks", palette="pastel")

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

# Draw a nested boxplot to show bills by day and sex
sns.boxplot(x="day", y="total_bill", hue="sex", data=tips, palette="PRGn")
# Draw a nested boxplot to show bills by day and time
sns.boxplot(x="day", y="total_bill",
hue="smoker", palette=["m", "g"],
data=tips)
sns.despine(offset=10, trim=True)
8 changes: 5 additions & 3 deletions examples/grouped_violinplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Grouped violinplots with split violins
======================================
_thumb: .5, .47
_thumb: .43, .47
"""
import seaborn as sns
sns.set(style="whitegrid", palette="pastel", color_codes=True)
Expand All @@ -11,6 +11,8 @@
tips = sns.load_dataset("tips")

# Draw a nested violinplot and split the violins for easier comparison
sns.violinplot(x="day", y="total_bill", hue="sex", data=tips, split=True,
inner="quart", palette={"Male": "b", "Female": "y"})
sns.violinplot(x="day", y="total_bill", hue="smoker",
split=True, inner="quart",
palette={"Yes": "y", "No": "b"},
data=tips)
sns.despine(left=True)
2 changes: 1 addition & 1 deletion examples/paired_pointplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
size=5, aspect=.5)

# Draw a seaborn pointplot onto each Axes
g.map(sns.pointplot, color=sns.xkcd_rgb["plum"])
g.map(sns.pointplot, scale=1.3, errwidth=4, color="xkcd:plum")
g.set(ylim=(0, 1))
sns.despine(fig=g.fig, left=True)
2 changes: 1 addition & 1 deletion examples/regression_marginals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Linear regression with marginal distributions
=============================================
_thumb: .5, .6
_thumb: .65, .65
"""
import seaborn as sns
sns.set(style="darkgrid")
Expand Down

0 comments on commit 8d72578

Please sign in to comment.