Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are a few issues with using ggplot and png in rmarkdown:

  1. Plot sizes: When using ggplot and rendering to a png file, the default size of the plot may be too small or too large for the rendered output in rmarkdown. This can result in the plot being cut off or appearing too small.

  2. Image quality: The quality of the rendered image may be low, resulting in a pixelated or blurry plot.

  3. File output location: The png file may not be saved in the expected location, causing issues when referencing it in rmarkdown.

  4. Rendering time: Rendering ggplot to a png file can be slow, especially when dealing with large datasets or complex plots. This can result in longer rendering times for the rmarkdown document.

To address these issues, it is often recommended to adjust the plot sizes, use a higher resolution rendering, ensure the png file is saved in the correct location, and potentially explore alternative rendering options such as saving the plot as a PDF or SVG file.