Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use png for html vignette figures #50

Merged
merged 1 commit into from
Nov 22, 2016
Merged

use png for html vignette figures #50

merged 1 commit into from
Nov 22, 2016

Conversation

tjmahr
Copy link
Collaborator

@tjmahr tjmahr commented Nov 19, 2016

The figures are not showing up in the CRAN vignettes.

If you need both pdf and png output, try using a vector with c("png", "pdf") in the dev option.

@codecov-io
Copy link

Current coverage is 100% (diff: 100%)

No coverage report found for master at 3f0e3dc.

Powered by Codecov. Last update 3f0e3dc...011b500

@jgabry
Copy link
Member

jgabry commented Nov 19, 2016

Thanks, glad you spotted that! The figures look fine if opening the
vignettes locally (after installing from CRAN) but they definitely aren't
rendering in the version hosted on CRAN's website. I was using pdf for the
images because it's a pain in the ass to get properly sized high quality
png figures using the html_vignette format with knitr and rmarkdown. The
default gives poor quality images (see for example the images in the
rstanarm vignettes on the CRAN website), but if you increase the dpi then
you have to manually adjust all figure sizes, and then if you want to
change the dpi you have to do that again every time. That was getting super
annoying. Any tips on how I can get same quality images as the ones using
pdf and with the same figure sizes?

On Sat, Nov 19, 2016 at 12:15 PM Codecov notifications@github.com wrote:

Current coverage https://codecov.io/gh/stan-dev/bayesplot/pull/50?src=pr
is 100% (diff: 100%)

No coverage report found for master at 3f0e3dc
3f0e3dc
.

Powered by Codecov https://codecov.io?src=pr. Last update
3f0e3dc...011b500
https://codecov.io/gh/stan-dev/bayesplot/compare/3f0e3dc7a5034a69309ae4e823fb7cc3072ed30f...011b5003bfdc228110bc93dd556d6d2f5e021fcf?src=pr


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#50 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHb4Q2BGypu3ETzy2W91MZ3fgku0sULcks5q_y63gaJpZM4K3Td3
.

@tjmahr
Copy link
Collaborator Author

tjmahr commented Nov 19, 2016

I follow the tips here: http://r4ds.had.co.nz/graphics-for-communication.html#figure-sizing

Yesterday, I posted about plotting fits from RStanARM models 😎 , and I used the following knitr options:

  opts_chunk$set(
    fig.asp = 0.618,
    fig.width = 6,
    dpi = 300,
    fig.align = "center",
    out.width = "80%")

To customize specific plots, then, you'd manipulate either out.width or fig.asp to adjust the size or dimensions.

Also, I tried it a bit with vignettes here. The frustrating thing is how long it can take to re-render the vignette after tweaking one of these options.

@jgabry
Copy link
Member

jgabry commented Nov 21, 2016

Thanks for the tips. I'll play around with the settings a bit based on those recommendations and see how it goes.

@jgabry jgabry merged commit f9f9a65 into stan-dev:master Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants