%useLatestDescriptors
%use lets-plot
// default theme
val dat = mapOf("x" to 0..4, "y" to 0..4)
val p = letsPlot(dat) +
geomPoint(tooltips = layerTooltips().title("TITLE").line("label|value")) {
x = "x"
y = "y"
size = "y"
color = "y"
} +
labs(title = "The plot title",
subtitle = "The plot subtitle",
caption = "The plot caption",
x = "X axis title",
y = "Y axis title",
color = "Color legend title",
size = "Size legend title"
)
p
// Change the font face property of some elements.
p + theme(
plotTitle = elementText(face = "italic"),
plotSubtitle = elementText(face = "bold_italic"),
plotCaption = elementText(face = "italic"),
legendTitle = elementText(face = "bold"),
legendText = elementText(face = "italic"),
axisTitle = elementText(face = "bold"),
axisText = elementText(face = "bold_italic"),
// The 'tooltipText' value will also applied to axes tooltips ('italic');
// title and label in general tooltip are bold by default -> the result for them is 'bold_italic'
tooltipText = elementText(face = "italic"))