Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _posts/r/scientific/2015-07-30-heatmaps.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ chart_link
The `colors` argument understands color brewer palettes (see `RColorBrewer::brewer.pal.info` for valid names).

```{r, results = 'hide'}
p <- plot_ly(z = volcano, colorscale = "Greys", type = "heatmap")
p <- plot_ly(z = volcano, colors = "Greys", type = "heatmap")

# Create a shareable link to your chart
# Set up API credentials: https://plot.ly/r/getting-started
chart_link = api_create(p, filename="heatmap-gray")
chart_link = api_create(p, filename="heatmap-grey")
chart_link
```

Expand Down
16 changes: 8 additions & 8 deletions _posts/r/scientific/2015-07-30-heatmaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ packageVersion('plotly')
```

```
## [1] '4.5.2'
## [1] '4.8.0'
```

#### Basic Heatmap
Expand All @@ -50,7 +50,7 @@ chart_link = api_create(p, filename="heatmap-simple")
chart_link
```

<iframe src="https://plot.ly/~RPlotBot/3224.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
<iframe src="https://plot.ly/~RPlotBot/5603.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>


#### Categorical Axes
Expand All @@ -69,23 +69,23 @@ chart_link = api_create(p, filename="heatmap-cat")
chart_link
```

<iframe src="https://plot.ly/~RPlotBot/3226.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
<iframe src="https://plot.ly/~RPlotBot/5605.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>

#### Sequential Colorscales: Greys

The `colors` argument understands color brewer palettes (see `RColorBrewer::brewer.pal.info` for valid names).


```r
p <- plot_ly(z = volcano, colorscale = "Greys", type = "heatmap")
p <- plot_ly(z = volcano, colors = "Greys", type = "heatmap")

# Create a shareable link to your chart
# Set up API credentials: https://plot.ly/r/getting-started
chart_link = api_create(p, filename="heatmap-gray")
chart_link = api_create(p, filename="heatmap-grey")
chart_link
```

<iframe src="https://plot.ly/~RPlotBot/3228.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
<iframe src="https://plot.ly/~RPlotBot/5607.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>

#### Custom colorscales

Expand All @@ -101,7 +101,7 @@ chart_link = api_create(p, filename="heatmap-ramp")
chart_link
```

<iframe src="https://plot.ly/~RPlotBot/3230.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
<iframe src="https://plot.ly/~RPlotBot/5609.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>

Or, you can do the scaling yourself and use the colorscale attribute directly...

Expand All @@ -119,5 +119,5 @@ chart_link = api_create(p, filename="heatmap-custom")
chart_link
```

<iframe src="https://plot.ly/~RPlotBot/3232.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>
<iframe src="https://plot.ly/~RPlotBot/5611.embed" width="800" height="600" id="igraph" scrolling="no" seamless="seamless" frameBorder="0"> </iframe>