Created
September 14, 2022 18:05
-
-
Save jthomasmock/1a3b386afca9dfbfbe6f3e54d4bdc841 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ex_bold <- ggplot(mtcars, aes(disp, mpg)) + | |
| geom_point() + | |
| labs( | |
| title = "<b>Fuel economy</b> vs. <i>engine displacement</i><br> | |
| <span style = 'font-size:10pt'>Lorem ipsum *dolor sit amet,* | |
| consectetur adipiscing elit, **sed do eiusmod tempor incididunt** ut | |
| labore et dolore magna aliqua. <span style = 'color:red;'>Ut enim | |
| ad minim veniam,</span> quis nostrud exercitation ullamco laboris nisi | |
| ut aliquip ex ea commodo consequat.</span>", | |
| x = "displacement (in<sup>3</sup>)", | |
| y = "Miles per gallon (mpg)<br><span style = 'font-size:8pt'>A measure of | |
| the car's fuel efficiency.</span>" | |
| ) + | |
| theme( | |
| plot.title.position = "plot", | |
| plot.title = element_textbox_simple( | |
| size = 13, | |
| lineheight = 1, | |
| padding = margin(5.5, 5.5, 5.5, 5.5), | |
| margin = margin(0, 0, 5.5, 0), | |
| fill = "cornsilk" | |
| ), | |
| axis.title.x = element_textbox_simple( | |
| width = NULL, | |
| padding = margin(4, 4, 4, 4), | |
| margin = margin(4, 0, 0, 0), | |
| linetype = 1, | |
| r = grid::unit(8, "pt"), | |
| fill = "azure1" | |
| ), | |
| axis.title.y = element_textbox_simple( | |
| hjust = 0, | |
| orientation = "left-rotated", | |
| minwidth = unit(1, "in"), | |
| maxwidth = unit(2, "in"), | |
| padding = margin(4, 4, 2, 4), | |
| margin = margin(0, 0, 2, 0), | |
| fill = "lightsteelblue1" | |
| ) | |
| ) | |
| ggsave("ex-bold.png", ex_bold) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment