Skip to content

Commit b7b0cd0

Browse files
committed
edits
1 parent 0f576cd commit b7b0cd0

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

_episodes/05-seaborn-viz.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ surveys_complete = pd.read_csv('surveys_complete.csv', index_col=0)
5858
~~~
5959
{: .python}
6060

61+
For this exercise, we will use a different version of the ecological dataset from our previous lessons. This version has only the complete observations, without missing entries for any of the columns. There are also a few additional columns providing information about the taxonomy of the species collected and the type of plot/enclosure.
62+
6163
## A Simple Scatterplot
6264

6365
Let's start with a basic scatterplot. We'll simply plot the weight on the horizontal axis and the hind foot length on the vertical axis. This uses the seaborn function `.lmplot()`. This function can take a Pandas DataFrame directly. It also will fit a regression line, by default. Since we may not want to visualize these data with a regression line, we will use the `fit_reg=False` argument.
@@ -143,7 +145,7 @@ sns.lmplot(x="weight", y="hindfoot_length", data=surveys_complete,
143145

144146
### Setting the axis labels
145147

146-
There are different ways to set figure properties using seaborn. For `.lmplot()`, we can create a figure variable and use a member method of tat variable to set the axis labels.
148+
There are different ways to set figure properties using seaborn. For `.lmplot()`, we can create a figure variable and use a member method of that variable to set the axis labels.
147149

148150
~~~
149151
my_fig = sns.lmplot(x="weight", y="hindfoot_length", data=surveys_complete,
@@ -165,7 +167,7 @@ my_fig.set_axis_labels('Weight (g)', 'Hindfoot Length (mm)')
165167
> Remember how to access subsets of a DataFrame based on conditional criteria?
166168
> Plot the scatter plot above for only plot number `12` and color by `sex`. (Make the markers larger circles.)
167169
>
168-
> > ## Solution
170+
<!-- > > ## Solution
169171
> >
170172
> > ~~~
171173
> > my_fig = sns.lmplot(x="weight", y="hindfoot_length",
@@ -178,7 +180,7 @@ my_fig.set_axis_labels('Weight (g)', 'Hindfoot Length (mm)')
178180
> > {: .python}
179181
> >
180182
> > ![png](../fig/05-seaborn-scatter-9.png)
181-
> {: .solution}
183+
> {: .solution} -->
182184
{: .challenge}
183185
184186
@@ -230,7 +232,7 @@ ax.set(ylabel='Species ID', xlabel='Weight (g)')
230232
> measurements for different sexed animals from a single
231233
> species, [*Onychomys leucogaster* (OL)](https://en.wikipedia.org/wiki/Northern_grasshopper_mouse), one of the coolest rodent species:
232234
>
233-
> > ## Solution
235+
<!-- > > ## Solution
234236
> >
235237
> > ~~~
236238
> > fig, ax = plt.subplots(figsize=plot_dims)
@@ -239,7 +241,7 @@ sns.violinplot(x='sex', y='weight', data=surveys_complete[surveys_complete.speci
239241
> > {: .python}
240242
> >
241243
> > ![png](../fig/05-seaborn-violinplot-2.png)
242-
> {: .solution}
244+
> {: .solution} -->
243245
{: .challenge}
244246
245247
# Histograms

0 commit comments

Comments
 (0)