Note that there are some explanatory texts on larger screens.

plurals
  1. POGraph subtle changes after using knitr from markdown
    primarykey
    data
    text
    <p>Using <code>knitr</code> and <code>markdown</code> packages to weave Rmd files to markdown and then html is producing some unexpected behavior in the way that ggplot2 graphs are appearing in the final html file.</p> <p>For example, using the following Rmd file diamond.Rmd</p> <pre><code># ggplot2 graph shows up fainter, and text smaller ```{r echo=FALSE, message=FALSE, warning=FALSE} opts_chunk$set(fig.width=18, fig.height=10) require(ggplot2) ``` *** # Simple Plot ```{r echo=FALSE, message=FALSE, warning=FALSE} data(diamonds) g &lt;- ggplot(diamonds, aes(carat, depth, colour=color)) + geom_point() + facet_wrap(~cut) g ``` </code></pre> <p>with this file knit.R</p> <pre><code>require(markdown) require(knitr) knit('diamonds.Rmd') markdownToHTML('diamonds.md', 'diamonds.html', options=c('base64_images')) browseURL(paste('file://', file.path(getwd(), 'diamonds.html'), sep='')) </code></pre> <p>I've taken a screeenshot of the plot in the html file and included it below (is there a better way to show this?):</p> <p><img src="https://i.stack.imgur.com/Gu2TK.png" alt="plot from html file"></p> <p>The plot inside the html file is lighter, ie the color is less dark. Also, the text on the plot, including the axis labels and the tick mark labels are smaller and lighter, making them very difficult to read.</p> <p>If you look at the plot created directly from R, you'll see it doesn't have those problems.</p> <p><img src="https://i.stack.imgur.com/dxFVa.png" alt="plot directly from R"></p> <p>I'm guessing this is some issue with my graphical device or the graphics device that knitr is using.</p> <p>Is there a way to force the plots that eventually end up in the html file to keep the original plot appearance, ie to stay darker and have larger text?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload