JasonKessler / scattertext

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

How to make points in the chart bigger? #113

Closed mvitha closed 2 years ago

mvitha commented 2 years ago

Is there a way to make the individual points in the chart bigger?

The idea would be to use the minimum_term_frequency to lower the number of terms that appear in the viz, and then make the font and bubble size bigger.

Any help would be much appreciated!

JasonKessler commented 2 years ago

No On Wed, Jun 22, 2022 at 11:41 AM mvitha @.***> wrote:

Is there a way to make the individual points in the chart bigger?

The idea would be to use the minimum_term_frequency to lower the number of terms that appear in the viz, and then make the font and bubble size bigger.

Any help would be much appreciated!

— Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/113, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMMXEK34WARRVBT7JH5Z3VQNM4ZANCNFSM5ZRIUURQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mikkokotila commented 12 months ago

You can easily achieve this by programmatically manipulating the HTML after it has been produced (before rendering it).

mikkokotila commented 12 months ago

Better yet, just add something similar to this as to your liking in terms of how you want to style your html before saving it to a file:

    html = re.sub(r'body {[^}]*}', 
                  "body {\n  font: 20px;\n  font-family: 'Noto Serif Tibetan', serif;\n  background-color: #f0f0f5;\n}", 
                  html)

    html = re.sub(r'\.attr\(\'font-size\', \'10px\'\)', 
                  ".attr('font-size', '18px')", 
                  html)