You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `plotnine` package (cfr. other packages conform [The Grammar of Graphics](http://link.springer.com/book/10.1007%2F0-387-28695-0)) supports the creation of complex plots from data in a
56
+
The `plotnine` package (cfr. other packages conform The Grammar of Graphics) supports the creation of complex plots from data in a
57
57
dataframe. It uses default settings, which help creating publication quality
58
58
plots with a minimal amount of settings and tweaking.
59
59
@@ -148,7 +148,7 @@ and `y` axis you set up in `aes()`.
148
148
- You can also specify aesthetics for a given `geom` independently of the
149
149
aesthetics defined globally in the `ggplot()` function.
150
150
151
-
# Building your plots iteratively
151
+
## Building your plots iteratively
152
152
153
153
Building plots with `plotnine` is typically an iterative process. We start by
154
154
defining the dataset we'll use, lay the axes, and choose a geom. Hence, the
@@ -258,7 +258,7 @@ set the background to white using the function `theme_bw()`.
258
258
> Adapt the bar plot of the previous exercise by mapping the `sex` variable to
259
259
> the color fill of the bar chart. Change the `scale` of the color fill by
260
260
> providing the colors `blue` and `orange` manually
261
-
> (see [API reference](https://plotnine.readthedocs.io/en/stable/api.html#Color-and-fill-scales) to find the appropriate function).
261
+
> (see [API reference][plotnine-api] to find the appropriate function).
262
262
>
263
263
> > ## Answers
264
264
> >
@@ -276,7 +276,7 @@ set the background to white using the function `theme_bw()`.
276
276
{: .challenge}
277
277
278
278
279
-
# Plotting distributions
279
+
## Plotting distributions
280
280
281
281
Visualizing distributions is a common task during data exploration and
282
282
analysis. To visualize the distribution of `weight` within each `species_id`
@@ -345,7 +345,7 @@ better idea of the number of measurements and of their distribution:
345
345
{: .challenge}
346
346
347
347
348
-
# Plotting time series data
348
+
## Plotting time series data
349
349
350
350
Let's calculate number of counts per year for each species. To do that we need
351
351
to group data first and count the species (`species_id`) within each group.
@@ -395,7 +395,7 @@ modifying the aesthetic function and map the species_id to the color:
395
395
396
396

397
397
398
-
# Faceting
398
+
## Faceting
399
399
400
400
As any other library supporting the Grammar of Graphics, `plotnine` has a
401
401
special technique called *faceting* that allows to split one plot into multiple
As the syntax of `plotnine` follows the original R package `ggplot2`, the
512
512
documentation of `ggplot2` can provide information and inspiration to customize
513
-
graphs. Take a look at the `ggplot2` [cheat sheet](https://www.rstudio.com/wp-content/uploads/2015/08/ggplot2-cheatsheet.pdf), and think of ways to improve the plot. You can write down some
514
-
of your ideas as comments in the Etherpad.
513
+
graphs. Take a look at the `ggplot2` [cheat sheet][ggplot2-cheat-sheet], and think of ways to
514
+
improve the plot. You can write down some of your ideas as comments in the Etherpad.
515
515
516
516
The theming options provide a rich set of visual adaptations. Consider the
517
517
following example of a bar plot with the counts per year.
0 commit comments