Skip to content

Commit

Permalink
Finished posts/ggplot2-vs-plotnine
Browse files Browse the repository at this point in the history
  • Loading branch information
christophscheuch committed Jan 14, 2024
1 parent 7827a85 commit 33aff62
Show file tree
Hide file tree
Showing 47 changed files with 907 additions and 288 deletions.
111 changes: 111 additions & 0 deletions .Rhistory
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,114 @@ penguins
penguins |> distinct(year)
penguins |> dplyr::distinct(year)
PalmerPenguins
library(ggplot2)
library(palmerpenguins)
penguins <- na.omit(palmerpenguins::penguins)
ggplot(penguins,
aes(x = bill_length_mm, y = bill_depth_mm,
color = species, shape = species)) +
geom_point() +
geom_smooth(method = "lm", formula = 'y ~ x') +
labs(x = "Bill length (mm)", y = "Bill Width (mm)",
title = "Bill Length vs. Bill Width",
subtitle = "Using geom_point and geom_smooth of the ggplot2 package",
color = "Species", shape = "Species") +
theme_minimal()
lggplot(penguins, aes(x = fct_infreq(species))) +
geom_bar()
ggplot(penguins, aes(x = fct_infreq(species))) +
geom_bar()
?fct_infreq
??fct_infreq
ggplot(penguins,
aes(x = species)) +
geom_bar()
penguins
ggplot(penguins,
aes(x = island)) +
geom_bar()
reticulate::repl_python()
penguins
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 200)
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 5)
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 10)
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 2.5)
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 2)
reticulate::repl_python()
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 2) +
geom_density()
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 2) +
geom_density()
ggplot(penguins,
aes(x = bill_length_mm)) +
# geom_histogram(binwidth = 2) +
geom_density()
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 2) +
geom_density()
ggplot(penguins,
aes(x = bill_length_mm)) +
geom_histogram(binwidth = 2)
reticulate::repl_python()
ggplot(penguins, aes(x = body_mass_g, color = species)) +
geom_density(linewidth = 0.75)
reticulate::repl_python()
ggplot(penguins,
aes(x = body_mass_g, color = species, fill = species)) +
geom_density(linewidth = 0.75, alpha = 0.5)
ggplot(penguins,
aes(x = body_mass_g, color = species, fill = species)) +
geom_density(size = 0.75, alpha = 0.5)
ggplot(penguins, aes(x = island, fill = species)) +
geom_bar(position = "fill")
reticulate::repl_python()
ggplot(penguins, aes(x = species, fill = island)) +
geom_bar(position = "fill")
reticulate::repl_python()
penguins
ggplot(penguins, aes(x = bill_length_mm, y = flipper_length_mm)) +
geom_point()
reticulate::repl_python()
ggplot(penguins,
aes(x = bill_length_mm, y = flipper_length_mm)) +
geom_point()
ggplot(penguins,
aes(x = bill_length_mm, y = flipper_length_mm)) +
geom_point(size = 2)
reticulate::repl_python()
ggplot(penguins, aes(x = flipper_length_mm, y = body_mass_g)) +
geom_point(aes(color = species, shape = species)) +
facet_wrap(~island)
ggplot(penguins,
aes(x = bill_length_mm, y = flipper_length_mm)) +
geom_point(aes(color = island, shape = island)) +
facet_wrap(~species)
reticulate::repl_python()
ggsave(penguins_figure, filename = "penguins-figure.png",
width = 4, height = 3, dpi = 300)
penguins_figure <- penguins |>
ggplot(aes(x = bill_length_mm, y = flipper_length_mm)) +
geom_point()
ggsave(penguins_figure, filename = "penguins-figure.png",
width = 4, height = 3, dpi = 300)
penguins_figure <- penguins |>
ggplot(aes(x = bill_length_mm, y = flipper_length_mm)) +
geom_point()
ggsave(penguins_figure, filename = "penguins-figure.png",
width = 7, height = 5, dpi = 300)
reticulate::repl_python()

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 27 additions & 10 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<link rel="stylesheet" href="assets/css/styles-global.css">
<link rel="stylesheet" href="assets/css/styles-blog.css">
<meta property="og:title" content="Tidy Intelligence Blog">
<meta property="og:image" content="https://blog.tidy-intelligence.com/posts/dplyr-vs-tidierdata/thumbnail.png">
<meta property="og:image" content="https://blog.tidy-intelligence.com/posts/ggplot2-vs-plotnine/thumbnail.png">
<meta property="og:site_name" content="Tidy Intelligence">
<meta property="og:image:height" content="1024">
<meta property="og:image:width" content="1024">
Expand Down Expand Up @@ -206,7 +206,24 @@

<div class="quarto-listing quarto-listing-container-grid" id="listing-listing">
<div class="list grid quarto-listing-cols-3">
<div class="g-col-1" data-index="0" data-listing-date-sort="1704754800000" data-listing-file-modified-sort="1704794537639" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="7" data-listing-word-count-sort="1373">
<div class="g-col-1" data-index="0" data-listing-date-sort="1705186800000" data-listing-file-modified-sort="1705246124435" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="8" data-listing-word-count-sort="1447">
<a href="./posts/ggplot2-vs-plotnine/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
<img src="./posts/ggplot2-vs-plotnine/thumbnail.png" class="thumbnail-image card-img" style="height: 100%;" alt="An image of a bright and friendly office setting with two equally sized screens placed centrally. Each screen displays a simple line chart without any text or numbers. The office is very well-lit, giving a warm and inviting ambiance. The decor is colorful and cheerful, with a minimalist design. The two screens are on a sleek, modern desk in the center of the image. The line charts are clear and straightforward. The overall atmosphere of the office is lively and welcoming, with vibrant colors and ample natural light. Created with DALL-E 3.">
</p>
<div class="card-body post-contents">
<h5 class="no-anchor card-title listing-title">
Tidy Data Visualization: ggplot2 vs plotnine
</h5>
<div class="card-text listing-description">
A comparison of implementations of the grammar of graphics in R and Python.
</div>
</div>
</div>
</a>
</div>
<div class="g-col-1" data-index="1" data-listing-date-sort="1704754800000" data-listing-file-modified-sort="1704794537639" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="7" data-listing-word-count-sort="1373">
<a href="./posts/dplyr-vs-tidierdata/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand All @@ -223,7 +240,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="1" data-listing-date-sort="1704582000000" data-listing-file-modified-sort="1704794267609" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="8" data-listing-word-count-sort="1404">
<div class="g-col-1" data-index="2" data-listing-date-sort="1704582000000" data-listing-file-modified-sort="1704794267609" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="8" data-listing-word-count-sort="1404">
<a href="./posts/dplyr-vs-pandas/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand All @@ -240,7 +257,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="2" data-listing-date-sort="1704322800000" data-listing-file-modified-sort="1704719563618" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="8" data-listing-word-count-sort="1436">
<div class="g-col-1" data-index="3" data-listing-date-sort="1704322800000" data-listing-file-modified-sort="1704719563618" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="8" data-listing-word-count-sort="1436">
<a href="./posts/dplyr-vs-ibis/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand All @@ -257,7 +274,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="3" data-listing-date-sort="1704150000000" data-listing-file-modified-sort="1704794243295" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="7" data-listing-word-count-sort="1390">
<div class="g-col-1" data-index="4" data-listing-date-sort="1704150000000" data-listing-file-modified-sort="1704794243295" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="7" data-listing-word-count-sort="1390">
<a href="./posts/dplyr-vs-polars/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand All @@ -274,7 +291,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="4" data-listing-date-sort="1701126000000" data-listing-file-modified-sort="1701172011575" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="10" data-listing-word-count-sort="1868">
<div class="g-col-1" data-index="5" data-listing-date-sort="1701126000000" data-listing-file-modified-sort="1701172011575" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="10" data-listing-word-count-sort="1868">
<a href="./posts/dax-seasonality/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand All @@ -291,7 +308,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="5" data-listing-date-sort="1701039600000" data-listing-file-modified-sort="1701259516979" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="11" data-listing-word-count-sort="2082">
<div class="g-col-1" data-index="6" data-listing-date-sort="1701039600000" data-listing-file-modified-sort="1701259516979" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="11" data-listing-word-count-sort="2082">
<a href="./posts/scraping-esg-data-from-yahoo-finance/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand All @@ -308,7 +325,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="6" data-listing-date-sort="1700866800000" data-listing-file-modified-sort="1703233137705" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="15" data-listing-word-count-sort="3000">
<div class="g-col-1" data-index="7" data-listing-date-sort="1700866800000" data-listing-file-modified-sort="1703233137705" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="15" data-listing-word-count-sort="3000">
<a href="./posts/clustering-binary-data/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand All @@ -325,7 +342,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="7" data-listing-date-sort="1700780400000" data-listing-file-modified-sort="1704387661622" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="12" data-listing-word-count-sort="2215">
<div class="g-col-1" data-index="8" data-listing-date-sort="1700780400000" data-listing-file-modified-sort="1704387661622" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="12" data-listing-word-count-sort="2215">
<a href="./posts/tidy-data-a-recipe-for-efficient-data-analysis/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand All @@ -342,7 +359,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="8" data-listing-date-sort="1684706400000" data-listing-file-modified-sort="1701259011519" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="12" data-listing-word-count-sort="2380">
<div class="g-col-1" data-index="9" data-listing-date-sort="1684706400000" data-listing-file-modified-sort="1701259011519" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="12" data-listing-word-count-sort="2380">
<a href="./posts/tidy-collaborative-filtering/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand Down
1 change: 1 addition & 0 deletions docs/listings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"listing": "/index.html",
"items": [
"/posts/ggplot2-vs-plotnine/index.html",
"/posts/dplyr-vs-tidierdata/index.html",
"/posts/dplyr-vs-pandas/index.html",
"/posts/dplyr-vs-ibis/index.html",
Expand Down
4 changes: 2 additions & 2 deletions docs/posts/clustering-binary-data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.533">
<meta name="generator" content="quarto-1.4.538">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down Expand Up @@ -978,7 +978,7 @@ <h2 class="anchored" data-anchor-id="model-comparison">Model comparison</h2>
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"loop":false,"closeEffect":"zoom","selector":".lightbox","openEffect":"zoom","descPosition":"bottom"});
<script>var lightboxQuarto = GLightbox({"openEffect":"zoom","closeEffect":"zoom","loop":false,"selector":".lightbox","descPosition":"bottom"});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
4 changes: 2 additions & 2 deletions docs/posts/dax-seasonality/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.533">
<meta name="generator" content="quarto-1.4.538">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down Expand Up @@ -972,7 +972,7 @@ <h2 class="anchored" data-anchor-id="evaluating-trading-strategies">Evaluating T
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"loop":false,"closeEffect":"zoom","openEffect":"zoom","descPosition":"bottom","selector":".lightbox"});
<script>var lightboxQuarto = GLightbox({"selector":".lightbox","openEffect":"zoom","closeEffect":"zoom","loop":false,"descPosition":"bottom"});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
2 changes: 1 addition & 1 deletion docs/posts/dplyr-vs-ibis/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.533">
<meta name="generator" content="quarto-1.4.538">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
2 changes: 1 addition & 1 deletion docs/posts/dplyr-vs-pandas/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.533">
<meta name="generator" content="quarto-1.4.538">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
2 changes: 1 addition & 1 deletion docs/posts/dplyr-vs-polars/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.533">
<meta name="generator" content="quarto-1.4.538">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down
Loading

0 comments on commit 33aff62

Please sign in to comment.