8000 add dependencies to imshow examples · plotly/plotly.r-docs@cb7074f · GitHub
[go: up one dir, main page]

Skip to content

Commit cb7074f

Browse files
author
Joseph Damiba
committed
add dependencies to imshow examples
1 parent 5934b75 commit cb7074f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

r/2020-02-25-imshow.Rmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ fig
3333
In order to create a numerical array to be passed to `Image` trace, you can use a third-party library like [EBImage](https://www.rdocumentation.org/packages/EBImage/versions/4.14.2) to open an image from a URL.
3434

3535
```{r}
36+
library(plotly)
3637
library(EBImage)
3738
3839
img = readImage('https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/240px-Crab_Nebula.jpg')
@@ -47,6 +48,7 @@ The default value of `zmin` and [zmax](https://plot.ly/r/reference/#image-zmax)
4748

4849
```{r}
4950
library(plotly)
51+
library(EBImage)
5052
5153
img = readImage('https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/240px-Crab_Nebula.jpg')
5254
# Stretch the contrast of the red channel only, resulting in a more red image
@@ -58,6 +60,7 @@ fig
5860

5961
```{r}
6062
library(plotly)
63+
library(EBImage)
6164
6265
img = readImage('https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/240px-Crab_Nebula.jpg')
6366
fig <- plot_ly(type="image", z=img*250)
@@ -70,6 +73,7 @@ fig
7073
### Combine image charts and other traces
7174

7275
```{r}
76+
library(plotly)
7377
library(EBImage)
7478
img = readImage('https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/240px-Crab_Nebula.jpg')
7579

0 commit comments

Comments
 (0)
0