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
Copy file name to clipboardExpand all lines: 02_develop_visualization.qmd
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Current Canadian sentiment reflects significant economic uncertainty, with risin
15
15
16
16
# Introduction
17
17
18
-
Plotnine is a python data visualization graphics, heavily inspired by `ggplot2`. Having extensive experience with `ggplot2` and R but less with python, I'm excited to explore plotnine through this submission.
18
+
Plotnine is a python data visualization graphics, heavily inspired by [ggplot2](https://ggplot2.tidyverse.org/). Having extensive experience with `ggplot2` and R but less with python, I'm excited to explore plotnine through this submission.
19
19
20
20
In this tutorial, I'll walk through the process of creating my plotnine 2025 contest submission: A visualization of that tracks employment across Canadian industries, ranked by their monthly percent change in employment. This visualization reveals which industries are expanding versus contracting in Canada's economic climate over time.
21
21
@@ -33,7 +33,7 @@ In this initial code chunk we initialize some [parameters](https://quarto.org/do
33
33
from pyprojroot import here # <1>
34
34
```
35
35
36
-
1.`pyprojroot` is similar to R's package `here`, which lets us construct filepaths relative to the project root. This is very convenient especially for quarto projects with complex file organization.
36
+
1.`pyprojroot` is similar to R's package [here](https://here.r-lib.org/), which lets us construct filepaths relative to the project root. This is very convenient especially for quarto projects with complex file organization.
37
37
38
38
```{python}
39
39
# | tags: [parameters]
@@ -75,16 +75,14 @@ The data we are using is from a table called "Employment by industry, monthly, s
75
75
76
76
The visualization required a fair amount of data processing which is detailed in this [page](01_develop_data_processing.html). The steps are summarized here:
77
77
78
-
[`read_labourcan`](../py/labourcan/data_processing.py) returns a `polars.Data.Frame` with:
78
+
[`read_labourcan`](https://github.com/wvictor14/labourcan/blob/main/py/labourcan/data_processing.py) returns a `polars.Data.Frame` with:
79
79
80
80
- Unused columns removed
81
81
- Filtered to seasonally adjusted estimates only
82
82
- Filtered to Canada level estimates
83
83
- Additional `YEAR`, `MONTH`, and `DATE_YMD` columns extracted from `REF_DATE`
84
84
- Sorted chronologically by year and month
85
85
86
-
See [labour.qmd](02_develop_data_processing.html) for details on data processing.
1. Use inline regex to remove the trailing special characters
610
608
2. add `subtitle_text` to `labs`
611
609
610
+
# Conclusion
611
+
612
+
That concludes the end of this tutorial. See the [main page](index.qmd) for the complete visualization with some interactivity to allow filtering through industry-specific trends.
613
+
614
+
Overall, plotnine is a fantastic addition to Python's data visualization universe. Although I found some differences and missing functionality compared to R's `ggplot2`, I was still able to create a complex visualization with relative ease. And, plotnine is still in early days, so I expect improvements and fixes will be developed in future releases.
0 commit comments