figure | R Documentation |
Bundles a ggplot/cowplot object, file reference, the final rendered graphic dimensions and markdown references in one figure object.
figure(
x,
label,
w,
h,
unit = c("mm", "cm", "in"),
ref_name = NULL,
caption = NULL,
legend_text = NULL
)
x |
a ggplot/cowplot object |
label |
the final file name |
w |
the final width after saving/rendering |
h |
the final height after saving/rendering |
unit |
the unit of h and w, mm be default |
ref_name |
optional, name of the reference to the figure, used mainly in markdown documents. |
caption |
optional, text to be presented in the figure caption. |
legend_text |
optional, text to be presented in the extended figure legend. |
ref_name: needs to be a valid markdown/bookdown reference name. By default, spaces, slashes and underscores are silently turned into '-'. You may easily insert the read-to-use figure object code chunk into your Rmarkdown document with the 'insert()' method or reference it in the text by calling 'refer()'.
An object of class 'figure'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.