<jupyter_start><jupyter_text>Plotting in R is displayed automatically, but if you want to display a PNG from another source, this is how to do it:<jupyter_code>tf <- tempfile()
png(tf)
plot(1:10, 1:10)
dev.off()
display_png(file = tf)<jupyter_output><empty_output><jupyter_text>The following will result in the preferred image format being chosen by the frontend:<jupyter_code>publish_mimebundle(list(
    'image/svg+xml' = '<svg width="10" height="10"><circle r="5" cx="5" cy="5"/></svg>',
    'text/plain'    = 'A circle'))<jupyter_output><empty_output><jupyter_text>There are a few convenience function to display individual representations with common metadata:<jupyter_code>display_png(file = tf, width = 50, height = 50)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12698412698412698, 'fraction_numerical': 0.022486772486772486, 'mean_word_length': 7.053191489361702, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '361949', 'license': 'MIT', 'n_tokens_mistral': 267, 'n_tokens_neox': 252, 'n_words': 70, 'path': 'Display.ipynb', 'repo_name': 'ChinaQuants/IRkernel', 'size': '756'}