Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project - Mafalda González González #95

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

mafaldi
Copy link

@mafaldi mafaldi commented Jan 3, 2025

initial commit (2nd try)

Copy link

netlify bot commented Jan 3, 2025

Deploy Preview for mucss-dataviz ready!

Name Link
🔨 Latest commit 6184daa
🔍 Latest deploy log https://app.netlify.com/sites/mucss-dataviz/deploys/67812577ed887b0008a55519
😎 Deploy Preview https://deploy-preview-95--mucss-dataviz.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@Enchufa2 Enchufa2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good work! Some comments below.

_projects/2024/100546612/100546612.Rmd Show resolved Hide resolved
Comment on lines +28 to +38
### The original graph

The original graph portrays the relationship between the share living in extreme poverty and the GDP per capita in 8 world regions and the global average between the years 1817 and 2017.

::: {style="display: flex; align-items: flex-start; gap: 15px; overflow: hidden;"}
```{=html}
<img src="Growth-and-poverty-since-1820.png"
style="width: 300px;"/>
```
<p>The graphs strengths include its clear comparison between the world regions wealth and poverty trends, which highlight the significant variation between regions, and its historical perspective, which provides some context for the global and regional progress. Visually, the regional facets and colouring contribute to their acute distinction and provide clarity and readability.</p>
:::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this redundant with the above? I mean adding a subsection and showing the graph again.

Copy link
Author

@mafaldi mafaldi Jan 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true. i have now moved it to the improvement as a segway to explain the changes

# dowload fonts
sysfonts::font_add_google("Playfair Display", family = "playfair display")
sysfonts::font_add_google("Lato", family = "lato")
sysfonts::font_add(regular = "./Lato/Lato-Light.ttf", family = "lato_light")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to load the font again from Google Fonts with the appropriate weight. Remove please the folder with the font sources, and here you can do something like:

sysfonts::font_add_google("Lato", family = "lato_light", regular.wt=300)

Or less if you need it thinner.

---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add fig.showtext=TRUE so that the resulting fonts have a reasonable size.


The original graph's x axis `limits` does not start at 0 or end at the 50000 break, but rather starts and ends a bit later. Thus, we set the scales within facet_wrap free and manually determine the limits within each scale. The x axis limits apparently start at 800 (which is the minimum value of the GDP values) and seem to end at somewhere around 57000 (trial and error considering the logarithmic scale).

<aside>Explanation: even though we have set the scales free for all panels as a group in the `facet_wrap`, we have also pre-defined the scales for all panels individually in `scale_x_log10` and `scale_y_continuous`.</aside>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:))

_projects/2024/100546612/100546612.Rmd Show resolved Hide resolved

The dimensions I have chosen are:

`{r, layout="l-body-outset", fig.width = 8, fig.height = 5.8, fig.dpi = 300}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the fig.dpi specification from all chunks. The default should be enough for our purposes. Otherwise, images are too big, and the post takes a lot of bandwidth.

_projects/2024/100546612/100546612.Rmd Show resolved Hide resolved
_projects/2024/100546612/100546612.Rmd Show resolved Hide resolved
_projects/2024/100546612/100546612.Rmd Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants