Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4da92c

Browse files
committed
use matrix for z input instead of vector
1 parent f066373 commit a4da92c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

_posts/r/scientific/2015-07-30-contour-plots.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ library(plotly)
6161
p <- plot_ly(
6262
x = c(-9, -6, -5, -3, -1),
6363
y = c(0, 1, 4, 5, 7),
64-
z = c(10, 10.625, 12.5, 15.625, 20, 5.625, 6.25, 8.125, 11.25, 15.625, 2.5, 3.125, 5, 8.125, 12.5, 0.625, 1.25, 3.125,
65-
6.25, 10.625, 0, 0.625, 2.5, 5.625, 10),
64+
z = matrix(c(10, 10.625, 12.5, 15.625, 20, 5.625, 6.25, 8.125, 11.25, 15.625, 2.5, 3.125, 5, 8.125, 12.5, 0.625, 1.25, 3.125,
65+
6.25, 10.625, 0, 0.625, 2.5, 5.625, 10), nrow = 5, ncol = 5),
6666
type = "contour"
6767
)
6868

_posts/r/scientific/2015-07-30-contour-plots.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ packageVersion('plotly')
3434
```
3535

3636
```
37-
## [1] '4.7.1'
37+
## [1] '4.8.0'
3838
```
3939

4040
### Basic Contour
@@ -51,7 +51,7 @@ chart_link = api_create(p, filename="contour-basic")
5151
chart_link
5252
```
5353

54-
<iframe src="https://plot.ly/~RPlotBot/3115.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
54+
<iframe src="https://plot.ly/~RPlotBot/5511.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
5555

5656
### Set X and Y Coordinates
5757

@@ -62,8 +62,8 @@ library(plotly)
6262
p <- plot_ly(
6363
x = c(-9, -6, -5, -3, -1),
6464
y = c(0, 1, 4, 5, 7),
65-
z = c(10, 10.625, 12.5, 15.625, 20, 5.625, 6.25, 8.125, 11.25, 15.625, 2.5, 3.125, 5, 8.125, 12.5, 0.625, 1.25, 3.125,
66-
6.25, 10.625, 0, 0.625, 2.5, 5.625, 10),
65+
z = matrix(c(10, 10.625, 12.5, 15.625, 20, 5.625, 6.25, 8.125, 11.25, 15.625, 2.5, 3.125, 5, 8.125, 12.5, 0.625, 1.25, 3.125,
66+
6.25, 10.625, 0, 0.625, 2.5, 5.625, 10), nrow = 5, ncol = 5),
6767
type = "contour"
6868
)
6969

@@ -73,7 +73,7 @@ chart_link = api_create(p, filename="contour-coordinates")
7373
chart_link
7474
```
7575

76-
<iframe src="https://plot.ly/~RPlotBot/5139.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
76+
<iframe src="https://plot.ly/~RPlotBot/5515.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
7777

7878
### Set Size and Range of a Contours
7979

@@ -102,7 +102,7 @@ chart_link = api_create(p, filename="contour-range-of-contours")
102102
chart_link
103103
```
104104

105-
<iframe src="https://plot.ly/~RPlotBot/5141.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
105+
<iframe src="https://plot.ly/~RPlotBot/5517.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
106106

107107
### Smoothing Contour Lines
108108

@@ -150,7 +150,7 @@ chart_link = api_create(p, filename="contour-smoothing-lines")
150150
chart_link
151151
```
152152

153-
<iframe src="https://plot.ly/~RPlotBot/5143.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
153+
<iframe src="https://plot.ly/~RPlotBot/5519.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
154154

155155
### Smoothing Contour Coloring
156156

@@ -175,7 +175,7 @@ chart_link = api_create(p, filename="contour-smoothing-coloring")
175175
chart_link
176176
```
177177

178-
<iframe src="https://plot.ly/~RPlotBot/5145.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
178+
<iframe src="https://plot.ly/~RPlotBot/5521.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
179179

180180
### Add Contour Labels
181181

@@ -192,7 +192,7 @@ chart_link = api_create(p, filename="contour-labels")
192192
chart_link
193193
```
194194

195-
<iframe src="https://plot.ly/~RPlotBot/5135.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
195+
<iframe src="https://plot.ly/~RPlotBot/5523.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
196196

197197
### Create Matrix and Plot Contour
198198
This example is based on (this)[https://www.r-statistics.com/2016/07/using-2d-contour-plots-within-ggplot2-to-visualize-relationships-between-three-variables/] r-statistics post.
@@ -232,7 +232,7 @@ chart_link = api_create(p, filename="contour-advanced")
232232
chart_link
233233
```
234234

235-
<iframe src="https://plot.ly/~RPlotBot/3469.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
235+
<iframe src="https://plot.ly/~RPlotBot/5525.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
236236

237237
### 2D Density Contour Plot
238238

@@ -256,7 +256,7 @@ chart_link = api_create(p, filename="contour-joint")
256256
chart_link
257257
```
258258

259-
<iframe src="https://plot.ly/~RPlotBot/3117.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
259+
<iframe src="https://plot.ly/~RPlotBot/5527.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
260260

261261
### Contour Colorscales
262262

0 commit comments

Comments
 (0)