If you want to have finer control on which part of the code should use showtext, functions showtext_begin() and showtext_end() will help. ![]() If you want to use showtext globally, you can call the function showtext_auto() once, and then all the devices after that will automatically use showtext to render text, as the example in the beginning shows. This example should work on most graphics devices, including pdf(), png(), postscript(), and on-screen devices such as windows() on Windows and x11() on Linux. ![]() Legend("topright", legend = c("Truth", "OLS"), col = c("red", "black"), lty = 1) Text(1, 1, expression(paste("True model: ", y = x + 1)), Text(-0.5, 4.5, "This is the outlier", cex = 2, col = "steelblue", Title("Draw Plots Before You Fit A Regression", family = "bell") Xlab = "X variable", ylab = "Y variable", family = "gochi") Op = par(cex.lab = 2, cex.axis = 1.5, cex.main = 2) # Open a graphics device if you want, e.g. # Tell showtext the resolution of the device, # Automatically use showtext to render text for future devices ![]() Font_add_google("Covered By Your Grace", "grace")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |