Download AutomaticGraphDescription.Rmd

The point of this help page is to show how The BrailleR package can describe the graphs created by the ggplot2 package without the user having to specifcally ask for those descriptions.

We first create a fairly simple scatter plot with a smoothed line added. The following command creates the plot and stores it for later use. It does not produce the actual picture, but the details needed to produce the picture are all done just waiting to be used further.

library(ggplot2)
Graph = ggplot(mtcars, aes(y=mpg,x=hp)) + geom_point() + geom_smooth()

The old way

The text description of the graph will ultimately be found using the following command behind the scenes.

BrailleR::VI(Graph)
This is an untitled chart with no subtitle or caption.
It has x-axis 'hp' with labels 100, 200 and 300.
It has y-axis 'mpg' with labels 10, 20 and 30.
It has 2 layers.
Layer 1 is a set of 32 big solid circle points of which about 97% can be seen.
Layer 2 is a 'lowess' smoothed curve with 95% confidence intervals covering 21% of the graph.

Now, the graph is plotted, using:

plot(Graph)
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
graph appears but there will be no text description

test 1: BrailleR is NOT live as the graph gets plotted.

Note that in the past, the text description and the plotting required two separate commands. It doesn’t actually matter which is done first, but before July 2021, blind users had to use two commands. The VI() command used to be called after issuing the library(BrailleR) command, but that old way of working can’t be illustrated anymore so the combined BrailleR::VI() command was used here.

The automated way

now load the BrailleR package and plot the graph again.

library(BrailleR)
plot(Graph)
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
test 2: BrailleR is live as this graph gets plotted.

test 2: BrailleR is live as this graph gets plotted.

This is an untitled chart with no subtitle or caption.
It has x-axis 'hp' with labels 100, 200 and 300.
It has y-axis 'mpg' with labels 10, 20 and 30.
It has 2 layers.
Layer 1 is a set of 32 big solid circle points of which about 97% can be seen.
Layer 2 is a 'lowess' smoothed curve with 95% confidence intervals covering 21% of the graph.

But what if the blind user doesn’t want that description?

The BrailleR package has commands GoSighted() and GoBlind() to control the production of the automatic text descriptions. GoSighted() turns off those automated descriptions.

GoSighted()
By going sighted, you have turned off the automatic generation of text descriptions of graphs.
plot(Graph)
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
graph appears but there will be no text description

Test 3: Our graph plotted once we’ve turned off the critical option

So it works really well!!!

Package details

We used BrailleR version 1.1.0 and ggplot2 version 3.4.3 to generate this page. You should check that your versions of these packages are at least as recent.