Skip to content

Alt text for documentation #5226

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

Merged
merged 11 commits into from
Mar 15, 2023
Merged

Alt text for documentation #5226

merged 11 commits into from
Mar 15, 2023

Conversation

teunbrand
Copy link
Collaborator

@teunbrand teunbrand commented Mar 12, 2023

This PR aims to fix #5222.

Briefly it adds alt text to plots in the readme, vignettes and articles. I tried to structure alt text for plots in the following way:

  • What is being plotted?
  • What are details of the plot we should pay attention to?

Because the docs are structured a lot along the lines 'here is a basic plot that we'll modify in various ways', a lot of repetition occurs in describing what is being plotted. I don't know if this repetition is preferred or not by the target audience of alt text. Instead of this repetition, one could alternatively describe 'as the previous plot, but with the following changes'.

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

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

LGTM. @batpigandme can I get you to look quickly through this and confirm that this format is the right one for alt text when it comes to helping out readers with vision impairment?

@thomasp85 thomasp85 added this to the ggplot2 3.4.2 milestone Mar 13, 2023
Copy link
Contributor

@batpigandme batpigandme left a comment

Choose a reason for hiding this comment

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

Thanks so much. These are fantastic—you've done a really great job of highlighting the aspect of each plot that's relevant to the context. My edits are minor (I'd say 75% of them are just me hyphenating compound modifiers).

@@ -265,6 +319,11 @@ The [**scales**](https://scales.r-lib.org/) package offers a large number of fun
Use `scales::label_number()` to force decimal display of numbers rather than using scientific notation or use `scales::label_comma()` to insert a comma every three digits.

```{r}
#| fig.alt = "A scatter plot showing the median sale price of housing in Texas
#| on the x-axis and the total volume of sales on the y-axis. The labels of
#| the y-axis are written out in full, with commas marking groups of three
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#| the y-axis are written out in full, with commas marking groups of three
#| the y-axis labels are written out in full, with commas marking groups of three

Copy link
Collaborator Author

@teunbrand teunbrand Mar 15, 2023

Choose a reason for hiding this comment

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

The labels are mentioned in the line above, so I think we're safe for now :)

@teunbrand
Copy link
Collaborator Author

teunbrand commented Mar 15, 2023

Thanks for the thorough review, helpful suggestions and kind words @batpigandme! I apologise for the spelling mistake that got copied over a few times. With the exception of the change 'The labels of the y-axis are written out in full' --> 'The labels of the y-axis labels are written out in full', I've accepted all the suggestions.

@teunbrand teunbrand merged commit d6d0523 into tidyverse:main Mar 15, 2023
@teunbrand teunbrand deleted the docs_alt_text branch March 15, 2023 17:44
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.

Add alt text to plots and images
3 participants