Skip to content

Commit

Permalink
changes due to 1) the naming scheme of figures has changed (always ch…
Browse files Browse the repository at this point in the history
…unk-i.ext, yihui/knitr#704); 2) the url prefix has also changed (no longer use the r-forge one)
  • Loading branch information
yihui committed Oct 3, 2014
1 parent e65d5d8 commit c421504
Show file tree
Hide file tree
Showing 37 changed files with 78 additions and 78 deletions.
4 changes: 2 additions & 2 deletions 001-minimal.md
Expand Up @@ -41,13 +41,13 @@ It is easy.
plot(1:10)
```

![plot of chunk unnamed-chunk-2](http://animation.r-forge.r-project.org/knitr-ex/figure/001-minimal-unnamed-chunk-21.png)
![plot of chunk unnamed-chunk-2](http://db.yihui.name/knitr-examples/figure/001-minimal-unnamed-chunk-2-1.png)

```r
hist(rnorm(1000))
```

![plot of chunk unnamed-chunk-2](http://animation.r-forge.r-project.org/knitr-ex/figure/001-minimal-unnamed-chunk-22.png)
![plot of chunk unnamed-chunk-2](http://db.yihui.name/knitr-examples/figure/001-minimal-unnamed-chunk-2-2.png)

## inline code

Expand Down
2 changes: 1 addition & 1 deletion 002-minimal.tex
Expand Up @@ -80,7 +80,7 @@
\hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{100}\hlstd{))}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/002-minimal-foo}
\includegraphics[width=\maxwidth]{figure/002-minimal-foo-1}

\end{knitrout}

Expand Down
6 changes: 3 additions & 3 deletions 003-minimal.html
Expand Up @@ -99,10 +99,10 @@
<div class="chunk" id="html-cars-scatter"><div class="rcode"><div class="source"><pre class="knitr r"><span class="hl kwd">library</span><span class="hl std">(ggplot2)</span>
<span class="hl kwd">plot</span><span class="hl std">(mpg</span> <span class="hl opt">~</span> <span class="hl std">hp, mtcars)</span>
</pre></div>
</div><div class="rimage center"><img src="http://animation.r-forge.r-project.org/knitr-ex/figure/003-minimal-html-cars-scatter1.png" title="plot of chunk html-cars-scatter" alt="plot of chunk html-cars-scatter" class="plot" /></div><div class="rcode">
</div><div class="rimage center"><img src="http://db.yihui.name/knitr-examples/figure/003-minimal-html-cars-scatter-1.png" title="plot of chunk html-cars-scatter" alt="plot of chunk html-cars-scatter" class="plot" /></div><div class="rcode">
<div class="source"><pre class="knitr r"><span class="hl kwd">qplot</span><span class="hl std">(hp, mpg,</span> <span class="hl kwc">data</span> <span class="hl std">= mtcars)</span> <span class="hl opt">+</span> <span class="hl kwd">geom_smooth</span><span class="hl std">()</span>
</pre></div>
</div><div class="rimage center"><img src="http://animation.r-forge.r-project.org/knitr-ex/figure/003-minimal-html-cars-scatter2.png" title="plot of chunk html-cars-scatter" alt="plot of chunk html-cars-scatter" class="plot" /></div></div>
</div><div class="rimage center"><img src="http://db.yihui.name/knitr-examples/figure/003-minimal-html-cars-scatter-2.png" title="plot of chunk html-cars-scatter" alt="plot of chunk html-cars-scatter" class="plot" /></div></div>

<p>Errors, messages and warnings can be put into <code>div</code>'s
with different <code>class</code>es:</p>
Expand Down Expand Up @@ -137,7 +137,7 @@
</pre></div>
<div class="source"><pre class="knitr r"><span class="hl kwd">par3d</span><span class="hl std">(</span><span class="hl kwc">zoom</span> <span class="hl std">=</span> <span class="hl num">0.7</span><span class="hl std">)</span>
</pre></div>
</div><div class="rimage center"><img src="http://animation.r-forge.r-project.org/knitr-ex/figure/003-minimal-fancy-rgl.png" title="plot of chunk fancy-rgl" alt="plot of chunk fancy-rgl" class="plot" /></div></div>
</div><div class="rimage center"><img src="http://db.yihui.name/knitr-examples/figure/003-minimal-fancy-rgl-1.png" title="plot of chunk fancy-rgl" alt="plot of chunk fancy-rgl" class="plot" /></div></div>

<p>Well, everything seems to be working. Let's ask R what is the
value of &pi;? Of course it is <code class="knitr inline">3.1416</code>.</p>
Expand Down
2 changes: 1 addition & 1 deletion 005-latex.tex
Expand Up @@ -108,7 +108,7 @@
\hlkwd{plot}\hlstd{(cars)} \hlcom{# a scatter plot}
\end{alltt}
\end{kframe}
\includegraphics[width=.8\textwidth]{figure/latex-cairo-scatter}
\includegraphics[width=.8\textwidth]{figure/latex-cairo-scatter-1}

\end{knitrout}

Expand Down
2 changes: 1 addition & 1 deletion 006-minimal.rst
Expand Up @@ -76,7 +76,7 @@ Here is a plot:
qplot(hp, mpg, data = mtcars) + geom_smooth()


.. figure:: http://animation.r-forge.r-project.org/knitr-ex/figure/006-minimal-rst-plot.png
.. figure:: http://db.yihui.name/knitr-examples/figure/006-minimal-rst-plot-1.png
:alt: A ggplot2 example
:width: 360px

Expand Down
2 changes: 1 addition & 1 deletion 013-par.tex
Expand Up @@ -72,7 +72,7 @@
\hlkwd{hist}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{100}\hlstd{),} \hlkwc{main} \hlstd{=} \hlstr{""}\hlstd{)} \hlcom{# no main title}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/013-par-myplot}
\includegraphics[width=\maxwidth]{figure/013-par-myplot-1}

\end{knitrout}

Expand Down
2 changes: 1 addition & 1 deletion 016-device.tex
Expand Up @@ -59,7 +59,7 @@
\hlkwd{plot}\hlstd{(}\hlnum{1}\hlstd{,} \hlkwc{main} \hlstd{=} \hlstr{"Hello, Palatino"}\hlstd{,} \hlkwc{xlab} \hlstd{=} \hlstr{"This is x-axis"}\hlstd{,} \hlkwc{ylab} \hlstd{=} \hlstr{"This is y-axis"}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/016-device-dev-args}
\includegraphics[width=\maxwidth]{figure/016-device-dev-args-1}

\end{knitrout}

Expand Down
10 changes: 5 additions & 5 deletions 019-fig-caption.tex
Expand Up @@ -61,7 +61,7 @@
\end{alltt}
\end{kframe}\begin{figure}[]

\includegraphics[width=\maxwidth]{figure/019-fig-caption-test} \caption[]{$2 \times 2$ is 4\label{fig:test}}
\includegraphics[width=\maxwidth]{figure/019-fig-caption-test-1} \caption[]{$2 \times 2$ is 4\label{fig:test}}
\end{figure}


Expand Down Expand Up @@ -90,7 +90,7 @@
\end{alltt}
\end{kframe}\begin{figure}[]

\includegraphics[width=\maxwidth]{figure/019-fig-caption-t-test} \caption[The P-value is 0]{The P-value is 0.93\label{fig:t-test}}
\includegraphics[width=\maxwidth]{figure/019-fig-caption-t-test-1} \caption[The P-value is 0]{The P-value is 0.93\label{fig:t-test}}
\end{figure}


Expand All @@ -106,7 +106,7 @@
\end{alltt}
\end{kframe}\begin{figure*}[]

\includegraphics[width=\maxwidth]{figure/019-fig-caption-figure-asterisk} \caption[Figure * environment]{Figure * environment.\label{fig:figure-asterisk}}
\includegraphics[width=\maxwidth]{figure/019-fig-caption-figure-asterisk-1} \caption[Figure * environment]{Figure * environment.\label{fig:figure-asterisk}}
\end{figure*}


Expand All @@ -123,7 +123,7 @@
\end{kframe}\begin{figure}[]


{\centering \includegraphics[width=\maxwidth]{figure/019-fig-caption-two-caps1}
{\centering \includegraphics[width=\maxwidth]{figure/019-fig-caption-two-caps-1}

}

Expand All @@ -136,7 +136,7 @@
\end{kframe}\begin{figure}[]


{\centering \includegraphics[width=\maxwidth]{figure/019-fig-caption-two-caps2}
{\centering \includegraphics[width=\maxwidth]{figure/019-fig-caption-two-caps-2}

}

Expand Down
4 changes: 2 additions & 2 deletions 033-file-extension.tex
Expand Up @@ -77,7 +77,7 @@
\hlkwd{plot}\hlstd{(}\hlnum{1}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/033-file-extension-test-a.pdf}
\includegraphics[width=\maxwidth]{figure/033-file-extension-test-a-1.pdf}

\end{knitrout}

Expand All @@ -88,7 +88,7 @@
\hlkwd{plot}\hlstd{(}\hlnum{2}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/033-file-extension-test-b.png}
\includegraphics[width=\maxwidth]{figure/033-file-extension-test-b-1.png}

\end{knitrout}

Expand Down
2 changes: 1 addition & 1 deletion 034-chinese.html
Expand Up @@ -76,7 +76,7 @@
</pre></div>
<div class="source"><pre class="knitr r"><span class="hl kwd">plot</span><span class="hl std">(mtcars[,</span> <span class="hl num">1</span><span class="hl opt">:</span><span class="hl num">2</span><span class="hl std">])</span>
</pre></div>
</div><div class="rimage default"><img src="http://animation.r-forge.r-project.org/knitr-ex/figure/034-chinese-unnamed-chunk-1.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" class="plot" /></div></div>
</div><div class="rimage default"><img src="http://db.yihui.name/knitr-examples/figure/034-chinese-unnamed-chunk-1-1.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" class="plot" /></div></div>

<p>介不是好好的吗?</p>
</body>
Expand Down
2 changes: 1 addition & 1 deletion 040-grid-table.tex
Expand Up @@ -74,7 +74,7 @@
\hlkwd{grid.draw}\hlstd{(g)}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/040-grid-table-draw-table}
\includegraphics[width=\maxwidth]{figure/040-grid-table-draw-table-1}

\end{knitrout}

Expand Down
12 changes: 6 additions & 6 deletions 041-label-i.md
Expand Up @@ -17,38 +17,38 @@ This example shows how to generate chunk labels dynamically with the brew syntax
hist(mtcars$mpg[mtcars$cyl == 6], main = paste(6, "cylinders"))
```

![plot of chunk mpg-histogram-6](http://animation.r-forge.r-project.org/knitr-ex/figure/041-label-i-mpg-histogram-6.png)
![plot of chunk mpg-histogram-6](http://db.yihui.name/knitr-examples/figure/041-label-i-mpg-histogram-6-1.png)

```r
hist(mtcars$wt[mtcars$cyl == 6], main = paste(6, "cylinders"))
```

![plot of chunk weight-histogam-6](http://animation.r-forge.r-project.org/knitr-ex/figure/041-label-i-weight-histogam-6.png)
![plot of chunk weight-histogam-6](http://db.yihui.name/knitr-examples/figure/041-label-i-weight-histogam-6-1.png)

### 4

```r
hist(mtcars$mpg[mtcars$cyl == 4], main = paste(4, "cylinders"))
```

![plot of chunk mpg-histogram-4](http://animation.r-forge.r-project.org/knitr-ex/figure/041-label-i-mpg-histogram-4.png)
![plot of chunk mpg-histogram-4](http://db.yihui.name/knitr-examples/figure/041-label-i-mpg-histogram-4-1.png)

```r
hist(mtcars$wt[mtcars$cyl == 4], main = paste(4, "cylinders"))
```

![plot of chunk weight-histogam-4](http://animation.r-forge.r-project.org/knitr-ex/figure/041-label-i-weight-histogam-4.png)
![plot of chunk weight-histogam-4](http://db.yihui.name/knitr-examples/figure/041-label-i-weight-histogam-4-1.png)

### 8

```r
hist(mtcars$mpg[mtcars$cyl == 8], main = paste(8, "cylinders"))
```

![plot of chunk mpg-histogram-8](http://animation.r-forge.r-project.org/knitr-ex/figure/041-label-i-mpg-histogram-8.png)
![plot of chunk mpg-histogram-8](http://db.yihui.name/knitr-examples/figure/041-label-i-mpg-histogram-8-1.png)

```r
hist(mtcars$wt[mtcars$cyl == 8], main = paste(8, "cylinders"))
```

![plot of chunk weight-histogam-8](http://animation.r-forge.r-project.org/knitr-ex/figure/041-label-i-weight-histogam-8.png)
![plot of chunk weight-histogam-8](http://db.yihui.name/knitr-examples/figure/041-label-i-weight-histogam-8-1.png)
2 changes: 1 addition & 1 deletion 048-cars-demo.tex
Expand Up @@ -69,7 +69,7 @@
\end{alltt}
\end{kframe}

{\centering \includegraphics[width=\maxwidth]{figure/048-cars-demo-model}
{\centering \includegraphics[width=\maxwidth]{figure/048-cars-demo-model-1}

}

Expand Down
2 changes: 1 addition & 1 deletion 049-cars-demo.md
Expand Up @@ -12,6 +12,6 @@ fit <- lm(dist ~ speed, data = cars)
abline(fit, lwd = 2)
```

![plot of chunk model](http://animation.r-forge.r-project.org/knitr-ex/figure/049-cars-demo-model.png)
![plot of chunk model](http://db.yihui.name/knitr-examples/figure/049-cars-demo-model-1.png)

The slope of a simple linear regression is 3.9324.
2 changes: 1 addition & 1 deletion 050-allowframebreaks.tex
Expand Up @@ -72,7 +72,7 @@
## step> utils::example("lm", echo = FALSE)
\end{verbatim}

\includegraphics[width=.7\linewidth]{figure/050-allowframebreaks-step0}
\includegraphics[width=.7\linewidth]{figure/050-allowframebreaks-step0-1}
\begin{verbatim}
##
## step> ## End Don't show
Expand Down
6 changes: 3 additions & 3 deletions 053-beamer-only.tex
Expand Up @@ -75,9 +75,9 @@
\end{alltt}
\end{kframe}

{\centering \only<1>{\includegraphics[width=.5\linewidth]{figure/053-beamer-only-boring-plots1}}
\only<2>{\includegraphics[width=.5\linewidth]{figure/053-beamer-only-boring-plots2}}
\only<3>{\includegraphics[width=.5\linewidth]{figure/053-beamer-only-boring-plots3}}
{\centering \only<1>{\includegraphics[width=.5\linewidth]{figure/053-beamer-only-boring-plots-1}}
\only<2>{\includegraphics[width=.5\linewidth]{figure/053-beamer-only-boring-plots-2}}
\only<3>{\includegraphics[width=.5\linewidth]{figure/053-beamer-only-boring-plots-3}}

}

Expand Down
10 changes: 5 additions & 5 deletions 054-loop-plots.md
Expand Up @@ -12,20 +12,20 @@ for (i in 1:5) {

this is plot 1

![](http://animation.r-forge.r-project.org/knitr-ex/figure/054-loop-plots-loop1.png)
![](http://db.yihui.name/knitr-examples/figure/054-loop-plots-loop-1.png)

this is plot 2

![](http://animation.r-forge.r-project.org/knitr-ex/figure/054-loop-plots-loop2.png)
![](http://db.yihui.name/knitr-examples/figure/054-loop-plots-loop-2.png)

this is plot 3

![](http://animation.r-forge.r-project.org/knitr-ex/figure/054-loop-plots-loop3.png)
![](http://db.yihui.name/knitr-examples/figure/054-loop-plots-loop-3.png)

this is plot 4

![](http://animation.r-forge.r-project.org/knitr-ex/figure/054-loop-plots-loop4.png)
![](http://db.yihui.name/knitr-examples/figure/054-loop-plots-loop-4.png)

this is plot 5

![](http://animation.r-forge.r-project.org/knitr-ex/figure/054-loop-plots-loop5.png)
![](http://db.yihui.name/knitr-examples/figure/054-loop-plots-loop-5.png)
2 changes: 1 addition & 1 deletion 055-multicols.tex
Expand Up @@ -79,7 +79,7 @@
\hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{100}\hlstd{))}
\end{alltt}
\end{kframe}
\includegraphics[width=\maxwidth]{figure/055-multicols-test}
\includegraphics[width=\maxwidth]{figure/055-multicols-test-1}

\end{knitrout}

Expand Down
2 changes: 1 addition & 1 deletion 063-html5-figure.md
Expand Up @@ -18,6 +18,6 @@ Test:
plot(rnorm(100))
```

<figure><img src="http://animation.r-forge.r-project.org/knitr-ex/figure/063-html5-figure-test-plot.png"><figcaption>Some random numbers.</figcaption></figure>
<figure><img src="http://db.yihui.name/knitr-examples/figure/063-html5-figure-test-plot-1.png"><figcaption>Some random numbers.</figcaption></figure>

This is a very simple-minded `plot` hook; you should take a look at [knitr's default definition](https://github.com/yihui/knitr/blob/master/R/hooks-md.R) if you want to improve this hook function.
2 changes: 1 addition & 1 deletion 064-bib-plot.tex
Expand Up @@ -61,7 +61,7 @@
\hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{100}\hlstd{),} \hlkwc{xlab} \hlstd{=} \hlstr{"See \textbackslash{}\textbackslash{}cite\{lamport94\} for details"}\hlstd{)}
\end{alltt}
\end{kframe}
\input{figure/064-bib-plot-bib-plot.tikz}
\input{figure/064-bib-plot-bib-plot-1.tikz}

\end{knitrout}

Expand Down
24 changes: 12 additions & 12 deletions 067-graphics-options.tex
Expand Up @@ -76,15 +76,15 @@
\end{alltt}
\end{kframe}\begin{figure}[H]

\includegraphics[width=2in]{figure/067-graphics-options-fig-cap1} \caption[One plot]{One plot.\label{fig:fig-cap1}}
\includegraphics[width=2in]{figure/067-graphics-options-fig-cap-1} \caption[One plot]{One plot.\label{fig:fig-cap1}}
\end{figure}

\begin{kframe}\begin{alltt}
\hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{10}\hlstd{),} \hlkwc{pch} \hlstd{=} \hlnum{19}\hlstd{)}
\end{alltt}
\end{kframe}\begin{figure}[H]

\includegraphics[width=2in]{figure/067-graphics-options-fig-cap2} \caption[Another plot]{Another plot.\label{fig:fig-cap2}}
\includegraphics[width=2in]{figure/067-graphics-options-fig-cap-2} \caption[Another plot]{Another plot.\label{fig:fig-cap2}}
\end{figure}


Expand All @@ -99,12 +99,12 @@
\hlkwd{plot}\hlstd{(}\hlnum{1}\hlopt{:}\hlnum{10}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=1in]{figure/067-graphics-options-fig-out1}
\includegraphics[width=1in]{figure/067-graphics-options-fig-out-1}
\begin{kframe}\begin{alltt}
\hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{10}\hlstd{),} \hlkwc{pch} \hlstd{=} \hlnum{19}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=.4\linewidth]{figure/067-graphics-options-fig-out2}
\includegraphics[width=.4\linewidth]{figure/067-graphics-options-fig-out-2}

\end{knitrout}

Expand All @@ -117,12 +117,12 @@
\hlkwd{plot}\hlstd{(}\hlnum{1}\hlopt{:}\hlnum{10}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=2in,angle=30]{figure/067-graphics-options-fig-extra1}
\includegraphics[width=2in,angle=30]{figure/067-graphics-options-fig-extra-1}
\begin{kframe}\begin{alltt}
\hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{10}\hlstd{),} \hlkwc{pch} \hlstd{=} \hlnum{19}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=2in,angle=120]{figure/067-graphics-options-fig-extra2}
\includegraphics[width=2in,angle=120]{figure/067-graphics-options-fig-extra-2}

\end{knitrout}

Expand All @@ -136,12 +136,12 @@
\hlkwd{plot}\hlstd{(}\hlnum{1}\hlopt{:}\hlnum{10}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=1in]{figure/067-graphics-options-fig-width1}
\includegraphics[width=1in]{figure/067-graphics-options-fig-width-1}
\begin{kframe}\begin{alltt}
\hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{10}\hlstd{),} \hlkwc{pch} \hlstd{=} \hlnum{19}\hlstd{)}
\end{alltt}
\end{kframe}
\includegraphics[width=1in]{figure/067-graphics-options-fig-width2}
\includegraphics[width=1in]{figure/067-graphics-options-fig-width-2}

\end{knitrout}

Expand All @@ -161,9 +161,9 @@
\end{alltt}
\end{kframe}\begin{figure}[H]
\subfloat[one plot\label{fig:fig-sub1}]{
\includegraphics[width=.49\linewidth]{figure/067-graphics-options-fig-sub1} }
\includegraphics[width=.49\linewidth]{figure/067-graphics-options-fig-sub-1} }
\subfloat[the other one\label{fig:fig-sub2}]{
\includegraphics[width=.49\linewidth]{figure/067-graphics-options-fig-sub2} }\caption[two plots]{two plots\label{fig:fig-sub}}
\includegraphics[width=.49\linewidth]{figure/067-graphics-options-fig-sub-2} }\caption[two plots]{two plots\label{fig:fig-sub}}
\end{figure}


Expand All @@ -179,15 +179,15 @@
\end{alltt}
\end{kframe}\begin{figure}[H]

\includegraphics[width=2in]{figure/067-graphics-options-fig-margin1} \caption[ordinary figure]{ordinary figure\label{fig:fig-margin1}}
\includegraphics[width=2in]{figure/067-graphics-options-fig-margin-1} \caption[ordinary figure]{ordinary figure\label{fig:fig-margin1}}
\end{figure}

\begin{kframe}\begin{alltt}
\hlkwd{plot}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{10}\hlstd{),} \hlkwc{pch} \hlstd{=} \hlnum{19}\hlstd{)}
\end{alltt}
\end{kframe}\begin{sidewaysfigure}[H]

\includegraphics[width=2in]{figure/067-graphics-options-fig-margin2} \caption[sideways figure]{sideways figure\label{fig:fig-margin2}}
\includegraphics[width=2in]{figure/067-graphics-options-fig-margin-2} \caption[sideways figure]{sideways figure\label{fig:fig-margin2}}
\end{sidewaysfigure}


Expand Down

0 comments on commit c421504

Please sign in to comment.