JasonKessler / scattertext

Beautiful visualizations of how language differs among document types.
Apache License 2.0
2.23k stars 289 forks source link

Extract coordinates from produce_scattertext_explorer() #35

Closed ebaggott closed 6 years ago

ebaggott commented 6 years ago

I'm using Scattertext on Python 2.7. I would like to save the x coordinates and y coordinates that are used to plot produce_scattertext_explorer() for later use in a statistical program. How can I do that? Many thanks, this is great!

JasonKessler commented 6 years ago

Just pass return_data=True into produce_scattertext_explorer. You’ll see a dictionary containing a sh sub-dictionary listing terms and various cryptic values. The ox and oy values indicate a term’s position on the chart.

I’m currently without access to a computer, and will stay out of pocket until around August 3.

Best of luck, Jason

ebaggott commented 6 years ago

Thank you! This worked. For reference, return_data=True only worked for me on Python 3, not on Python 2.