# NOT RUN {
library(ggplot2)
ggplot(mtcars, aes(disp, mpg)) +
geom_point() +
labs(
title =
"<b><span style = 'font-size:13pt'>Fuel economy vs. engine displacement</span></b><br>
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.",
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 = 10,
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"
)
)
# }
Run the code above in your browser using DataLab