2

In page 19 of the stm tutorial, Figure 6: Graphical display of topical prevalence contrast

https://cran.r-project.org/web/packages/stm/vignettes/stmVignette.pdf

How to change the font size of the custom lables of Figure 6 (i.e., font size of 'Obama', 'Sarah Palin', 'Bush Presidency' become smaller / bigger)?

I've tried to add text.cex to the code, but has no results.

7
  • Perhaps there's an issue using the 'correct' plotting function; maybe try using plot.STM() with text.cex = 2, instead of plot(), and see if there's a difference? Commented May 9, 2024 at 1:16
  • Since I want to plot a graphical display of topical prevalence contrast, so I think using plot.STM() might not be appropriate Commented May 9, 2024 at 1:39
  • 1
    Right! Yep; the class of prep is "estimateEffect", so the plotting function used 'internally' when you type plot() is plot.estimateEffect() (github.com/bstewart/stm/blob/…). Unfortunately this plotting function doesn't appear to have a 'cex' parameter, or any other way of resizing the text. One option would be to run par(cex = 1.2) before you run your plot (all of the text is larger), or you could exclude the custom.labels and place the labels on the plot yourself. Sorry this wasn't the answer you were hoping for Commented May 9, 2024 at 8:08
  • 1
    Actually, try par(cex.axis = 1.4) before plotting and see you get your desired outcome @James Commented May 9, 2024 at 8:23
  • 1
    running par(cex = 1.2) before running the plot works for me. Thanks @jared_mamrot. I got another question. I wonder if I can decide the side of the text to be appeared. For example, for 'Obama' and 'Sarah Palin' I would like to put it on the left hand side of the dot while for 'Bush Presidency' I would like to put it on the right hand side of the dot. Is this possible? Commented May 9, 2024 at 9:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.