LDAvis
LDAvis copied to clipboard
How would I plot the intertopic distance in ggplot?
Well, the title says it all. I find the intertopic distance map quite useful in demonstrating how diverse (or not) a set of documents may be; but I'd quite like to run it through ggplot.
Any pointers? If all else fails, I can screenshot the plot and include it that way; but eeew :)
Not sure if this is still relevant but I found that you can access the plotting data through the json. Something like this worked for me:
json_obj <- jsonlite::fromJSON(json) # where json is the output from LDAvis::createJSON
mds_data <- as_tibble(json_obj$mdsDat) # can also use a data.frame
ggplot(mds_data, aes(x, y)) + geom_point()