how to display Urdu or Arabic script in ggplot

97 Views Asked by At

I am trying to visualize a network of words in Urdu but failed to display Urdu words as node_text properly.

title_word_pairs %>%
  filter(n >= 100) %>%
  graph_from_data_frame() %>%
  ggraph(layout = "fr") +
  geom_edge_link(aes(edge_alpha = n, edge_width = n), edge_colour = "cyan4") +
  geom_node_point(size = 3) +
  geom_node_text(aes(label = name), repel = TRUE, 
                 point.padding = unit(0.2, "lines")) +
  theme_void()

enter image description here

I tried displayArabic function from the "DisplayArabic" package, but still it did not work.

title_word_pairs %>%
  filter(n >= 100) %>%
  graph_from_data_frame() %>%
  ggraph(layout = "fr") +
  geom_edge_link(aes(edge_alpha = n, edge_width = n), edge_colour = "cyan4") +
  geom_node_point(size = 3) +
  geom_node_text(aes(label = displayArabic(toString(name))), repel = TRUE, 
                 point.padding = unit(0.2, "lines")) +
  theme_void()

enter image description here

0

There are 0 best solutions below