Skip to content

Conversation

@jennybc
Copy link
Member

@jennybc jennybc commented Oct 31, 2017

Meant to combat figs that run off the page for README.html that CRAN creates and hosts.

Suggests the use of, e.g.,

knitr::include_graphics("man/figures/i-already-exist.png")

for pre-made figs.

Meant to combat figs that run off the page for README.html that CRAN creates and hosts.

Suggests the use of, e.g.,

```{r echo = FALSE}
knitr::include_graphics("man/figures/i-already-exist.png")
```

for pre-made figs.
@hadley
Copy link
Member

hadley commented Nov 2, 2017

Do we really want them that wide?

@jennybc
Copy link
Member Author

jennybc commented Nov 2, 2017

Hmmm ... I just saw this as a huge improvement over the status quo in some of my projects.

I'll explain how I got here, in case it's all dysfunction on my end:

  • I often use quick and dirty measures to make a figure look better 😬. At the time of ggsave(), I make it physically larger than necessary, so that it looks nice and sharp wherever I need to use it later. Such as in a README. Ergo I need to specify figure width.
  • I often put two figure side-by-side via fig.show = 'hold', out.width = '49%', which reinforced my choice of 49 + 49 = 98 ~= 100.

@hadley
Copy link
Member

hadley commented Nov 2, 2017

Hmmm, maybe I'm getting confused about how they're sized by default. Can you point me to the diff for the gapminder README? (which was the motivation IIRC)

@jennybc
Copy link
Member Author

jennybc commented Nov 2, 2017

Sure:

jennybc/gapminder@dd232a2

It causes figures to be embedded via an <img> tag with explicit width vs. Markdown image syntax.

@hadley hadley merged commit 8b7c89a into master Nov 2, 2017
@hadley hadley deleted the README-fig-width branch November 2, 2017 22:44
@jennybc
Copy link
Member Author

jennybc commented Nov 3, 2017

Thanks! Even if 100% is not quite the thing, now the syntax is there in case someone wants to adjust, delete, or move to a specific chunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants