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
{{ message }}
Repository navigation
[Doc]: Add alt text to figures in documentation #24309
None of our images have alt-text and that's becoming a standard now and our communication's guidelines say we should add alt-text when the platform allows.
Suggested improvement
The steps involved in having a consistent way to add alt text to our docs are
replace alt text guidelines in communication guidelines with a standalone documentation page on alt-text for visualization best practices, update links in communications and pull requests guidelines to post to it.
write tutorial on making accessible viz
document using alt_aria as part of and alt text and update the PR template w/ a nudge to use alt text
add alt text to gallery files: I do it here in order of visibility, but traffic is probably a better way to prioritize)
plot gallery - it feeds the home page gallery so is probably highest profile
tutorials - doesn't always have code for the images
gallery
narrative text
older whats news and anything missing from the above
Adding alt text is piles of work and probably would benefit from strategy and partnerships w/ classes/sprints or hiring someone depending on timeline.
PDF does also support alt-texts (and has some other accessibility support).
I think a parallel issue to this one is track down which file types/backends support alt-text and update accordingly. Tom put in support for svg in #21328
There are reasonable places to put "alt text" (although IPTC makes a distinction between "ald text" and "image description").
options:
minimal: nothing (but docs)! currently fig.savefig('...png', metadata={'alt': 'The alt text'}) works (any key works), also works fig.savefig('/tmp/test.svg', metadata={'Description': 'This is alt text'}) , fig.savefig('/tmp/test.pdf', metadata={'Alt': 'This is alt text'}) also works (but warns). Other raster formats do not work (fails in imsave), but that is a matter of sorting out the right invocation to pillow.
medium: add a alt_text keyword to savefig that is threaded through each of the backends to translate to the correct name for that file format
medium++: add a alt_text or description attribute to Figure that is the default value threaded through savefig(..., alt_text)
open questions:
do any screen readers actually look at these?
if there are conflicting standards, how to we pick with standard to follow?
Other tasks:
if we do medium++, teach matplotlib-inline to extract the same for the html
if we do the medium++, teach sphinx-gallery to extract the same
if we do medium++ have our plot directive respect this
Activity
oscargus commentedon Oct 31, 2022
PDF does also support alt-texts (and has some other accessibility support). See 14.9.3 Alternate Descriptions in https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf
story645 commentedon Oct 31, 2022
I think a parallel issue to this one is track down which file types/backends support alt-text and update accordingly. Tom put in support for svg in #21328
oscargus commentedon Dec 1, 2022
I just sent an email to a Swedish researcher asking for some pointers. Let us see if I get some answer. Also, found this paper which seems quite relevant: https://content.iospress.com/articles/technology-and-disability/tad170181 (I have not read it yet, but I guess the references and citing papers can be worthwhile, even if we may not be interested in automation in the first place).
Edit: this may be worthwhile checking as well https://viewplus.com/product/audio-graphing-calculator/
tacaswell commentedon May 9, 2024
https://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_PNG_files
https://iptc.org/std/photometadata/specification/IPTC-PhotoMetadata#alt-text-accessibility
https://exiv2.org/tags.html / https://www.cipa.jp/std/documents/e/DC-008-2012_E.pdf
There are reasonable places to put "alt text" (although IPTC makes a distinction between "ald text" and "image description").
options:
fig.savefig('...png', metadata={'alt': 'The alt text'})works (any key works), also worksfig.savefig('/tmp/test.svg', metadata={'Description': 'This is alt text'}),fig.savefig('/tmp/test.pdf', metadata={'Alt': 'This is alt text'})also works (but warns). Other raster formats do not work (fails inimsave), but that is a matter of sorting out the right invocation to pillow.alt_textkeyword tosavefigthat is threaded through each of the backends to translate to the correct name for that file formatalt_textordescriptionattribute toFigurethat is the default value threaded throughsavefig(..., alt_text)open questions:
Other tasks: