picture not appearing


I am trying to set the size of an image being included in the file below but {Width=10px, Height=10px is not working}

Can you advise how to set the size of the image?

Thank you

Here is the Rmd file:

  set_title: "My Title"
title: "Test"
subtitle: "Test"
    reference_doc: my_template.pptx

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE  )

## Slide with Image


Assuming that the image is created with ggplot save it thusly

plot = last_plot(),
device = 'svg', 
path = 'images',
scale = 1, 
width = 6, 
height = 4, 
units = c("in"),
dpi = "retina", 
limitsize = TRUE)

which can be simpler than fiddling with markdown/HTML/css

Thanks for your response. I am not looking to save the image. It is already saved and I am looking to use {Width=10%, Height=10%} to resize it. The issue is {Width=10%, Height=10%} doesn't seem to work although it is referenced online.

I had seen in the OP that the image was not being generated in the script, but imported. Hence my suggestion.

Too much of data science degenerates into fiddling with reports so that they look good, which can be time better spent with the data and its analysis. My own preference is to defer presentation as long as possible and then deal with all the picky stuff in one pass.

There are alternate approaches to dealing with the image size problem:

  1. At the source, as I suggested
  2. Post-processing with the {egg} package, possibly
  3. Post processing externally by saving to pdf and re-sizing in a vector editor
  4. Attempting to dictate the size in markdown syntax
  5. Attempting to dictate the size in HTML syntax
  6. Attempting to dictate with size in css


Pandoc does not yet support this syntax for Powerpoint format.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.