0
  • Antecedent 1: A static hugo page generated by the blogdown R package.

  • Antecedent 2: A blog post created from a rmarkdown document with R plots.

  • Question: Some way to resize a plot produced by a chunk of R code in a rmarkdown post when I open the page from a mobile phone?

For example, all the content of this post is resize when I open from my mobile except the plot. How can achieve something like that?

Thank in advance!

Cristóbal Alcázar
  • 1,153
  • 14
  • 26

1 Answers1

2

The easiest way to resize images according to the available screen width is to set this CSS rule:

img {
  max-width: 100%;
}
Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
  • Yihui in the subdirectory public/css/main.css just add the above rule? – Cristóbal Alcázar Aug 23 '17 at 14:31
  • No, you should never touch `public/`. It is automatically generated from source. The `css/main.css` is either in your theme, or under `static/` of your root directory. If you are not sure, edit the one in your theme. – Yihui Xie Aug 23 '17 at 14:59