Description Usage Arguments Value Examples
View source: R/displayArabic.R
This function displays Arabic characters in the correct order using the correct connections in ggplot. It calls a python file in the DisplayArabic package that reverses the order of the Arabic characters using the python-bidi module and calls the correct character form based on the character's position in the word using the python arabic-reshaper module by Abdullah Diab and contributors (see: github.com/mpcabd/python-arabic-reshaper). The object the function returns will display Arabic strings correctly in ggplot.
1 | displayArabic(Arabic_string)
|
Arabic_string |
String you want to display in ggplot |
An Arabic string that will display correctly in ggplot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # An example of an Arabic plot label with and without displayArabic()
library(ggplot2) # Needed for plotting
## First, generate random points:
x <- data.frame(a=runif(10),b=runif(10))
## Plotting the points without displayArabic():
ggplot(x, aes(a,b)) +
geom_point() +
xlab("سلام")
## Plotting the points with displayArabic():
ggplot(x, aes(a,b)) +
geom_point() +
xlab(displayArabic("سلام"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.