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

Skip to content

Commit a2cd404

Browse files
author
yankev
committed
Merge branch 'source' of https://github.com/plotly/documentation into source
2 parents 6fb5393 + ea48087 commit a2cd404

File tree

75 files changed

+4997
-127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4997
-127
lines changed

_config_dev.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ gems:
66
BASE_URL: http://localhost:4000
77
staticurl: http://localhost:4000/all_static
88
# all of the posts: ['*.Rmd','_posts/2015-09-09-matlab-reference.html','_posts/2015-09-06-r-reference.html','_posts/2015-09-06-python-reference.html','_posts/2015-08-19-plotly_js-reference.html','_posts/2015-04-05-ggplot2-index.html','_posts/2015-04-05-julia-index.html','_posts/2015-04-05-matlab-index.html','_posts/2015-04-05-matplotlib-index.html','_posts/2015-04-05-node_js-index.html','_posts/2015-04-05-plotly_js-index.html','_posts/2015-04-05-plotlyjs-function-reference.md','_posts/2015-04-05-python-index.html','_posts/2015-05-25-ipython-notebooks_gallery.html','_posts/2015-05-25-ipython-notebooks_index.html','_posts/2015-07-13-eula_index.html','_posts/2015-07-19-pandas.html','_posts/2015-07-26-index.html','_posts/2015-07-30-r-index.Rmd','_posts/2015-07-30-r-index.md','_posts/2015-08-20-research-box-index.html','_posts/ggplot2','_posts/julia','_posts/matlab','_posts/matplotlib','_posts/nodejs','_posts/pandas','_posts/plotly_js','_posts/python','_posts/r','_posts/tutorials','_posts/user_guide_matlab','_posts/user_guide_python']
9-
#exclude: ['*.Rmd','_posts/2015-09-09-matlab-reference.html','_posts/2015-09-06-r-reference.html','_posts/2015-09-06-python-reference.html','_posts/2015-08-19-plotly_js-reference.html','_posts/2015-04-05-julia-index.html','_posts/2015-04-05-matlab-index.html','_posts/2015-04-05-matplotlib-index.html','_posts/2015-04-05-node_js-index.html','_posts/2015-04-05-plotly_js-index.html','_posts/2015-04-05-plotlyjs-function-reference.md','_posts/2015-04-05-python-index.html','_posts/2015-05-25-ipython-notebooks_gallery.html','_posts/2015-05-25-ipython-notebooks_index.html','_posts/2015-07-13-eula_index.html','_posts/2015-07-19-pandas.html','_posts/2015-07-26-index.html','_posts/2015-07-30-r-index.Rmd','_posts/2015-08-20-research-box-index.html','_posts/julia','_posts/matlab','_posts/matplotlib','_posts/nodejs','_posts/pandas','_posts/plotly_js','_posts/python','_posts/tutorials','_posts/user_guide_matlab','_posts/user_guide_python']
10-
exclude: ['*.Rmd','_posts/excel', '_posts/julia', '_posts/matplotlib', '_posts/python','_posts/pandas','_posts/plotly_js', '_posts/nodejs', '_posts/dashboards', '_posts/matlab']
9+
exclude: ['*.Rmd','_posts/2015-09-09-matlab-reference.html','_posts/2015-09-06-r-reference.html','_posts/2015-09-06-python-reference.html','_posts/2015-08-19-plotly_js-reference.html','_posts/2015-04-05-ggplot2-index.html','_posts/2015-04-05-julia-index.html','_posts/2015-04-05-matplotlib-index.html','_posts/2015-04-05-node_js-index.html','_posts/2015-04-05-plotly_js-index.html','_posts/2015-04-05-plotlyjs-function-reference.md','_posts/2015-04-05-python-index.html','_posts/2015-05-25-ipython-notebooks_gallery.html','_posts/2015-05-25-ipython-notebooks_index.html','_posts/2015-07-13-eula_index.html','_posts/2015-07-19-pandas.html','_posts/2015-07-26-index.html','_posts/2015-07-30-r-index.Rmd','_posts/2015-07-30-r-index.md','_posts/2015-08-20-research-box-index.html','_posts/ggplot2','_posts/julia','_posts/matplotlib','_posts/nodejs','_posts/pandas','_posts/plotly_js','_posts/python','_posts/r','_posts/tutorials','_posts/user_guide_python']
1110
plotlyjs_download_url: https://cdn.plot.ly/plotly-latest.min.js
1211
imgurl: https://images.plot.ly/plotly-documentation/
1312

_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer>
2-
<div class="plotly-footer">
2+
<div class="plotly-footer" id="footer">
33
{% include plotly_offline_cta.html %}
44
<div class="row footerarea footer-top" style="z-index: 100; position: relative;">
55
<div class="one column footcolumn space"> </div>

_layouts/langindex.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,36 @@
5050
$header = $("#header");
5151

5252
function setHeight() {
53+
var scrollbottom = $(document).height() - $(window).scrollTop() - $(window).height() - $("#footer").height();
5354
if($("#sidebar").length){
54-
var $sidebar = $("#sidebar");
55-
var $top = Math.max(50,(($header.height() + 50) - $window.scrollTop()));
55+
56+
if(scrollbottom > 0 ) {
57+
var $sidebar = $("#sidebar");
58+
var $top = Math.max(50,(($header.height() + 50) - $window.scrollTop()));
59+
var $bottom = "auto";
60+
console.log('top: '+$top+' bottom: '+$bottom);
61+
}
62+
else{
63+
/* corrects messing up of footer when scrolled to the bottom (for long sidebar )*/
64+
var $sidebar = $("#sidebar");
65+
var $top = Math.max(50 + scrollbottom, 0)?Math.max(50 + scrollbottom, 0):"auto";
66+
var $bottom = 0 - scrollbottom -50;
67+
}
5668
}
5769

5870
else if($("#reference-side-nav").length){
5971
var $sidebar = $("#reference-side-nav");
6072
var $top = Math.max(0,(($header.height() + 60) - $window.scrollTop()));
73+
var $bottom = null;
6174
}
6275

6376
else{
6477
var $sidebar = null; // dont do anything, if no sidebars
6578
var $top = 0;
79+
var $bottom = null;
6680
}
6781

68-
$sidebar.css({top: $top});
82+
$sidebar.css({top: $top, bottom: $bottom});
6983
}
7084
setHeight();
7185
$window.scroll(setHeight);

_posts/2015-05-25-ipython-notebooks_gallery.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ <h1>IPython Notebook Gallery</h1>
1313
<p>
1414
Instructions on how to install Plotly's Python package can be found on the <a class="no_underline plot-blue" href="{{ site.url }}/python/getting-started">Plotly for Python getting started page</a>.
1515
</p>
16+
<br>
17+
<p>
18+
Instructions on how to install IPython can be found <a class="no_underline plot-blue" href="http://ipython.org/install.html">here</a>.
19+
</p>
1620

1721
<section>
1822

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Change labels in <code>facet_wrap</code>
3+
plot_url: https://plot.ly/~RPlotBot/2901
4+
arrangement: horizontal
5+
language: ggplot2
6+
suite: wrap
7+
description: Inspired by <a href="http://stackoverflow.com/questions/3472980/ggplot-how-to-change-facet-labels">Stack Overflow</a>.
8+
order: 6
9+
sitemap: false
10+
---
11+
library(plotly)
12+
set.seed(123)
13+
14+
df <- diamonds[sample(1:nrow(diamonds), size = 1000), ]
15+
16+
# Create labels
17+
labs <- c("Best","Second best","Third best","Average", "Average","Third Worst","Second Worst","Worst")
18+
levels(df$clarity) <- rev(labs)
19+
20+
p <- ggplot(df, aes(carat, price)) +
21+
geom_point() +
22+
facet_wrap(~ clarity)
23+
24+
ggplotly(p)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Change order of facets in <code>facet_wrap</code>
3+
plot_url: https://plot.ly/~RPlotBot/2905/diamonds-dataset-facetted-by-clarity/
4+
arrangement: horizontal
5+
language: ggplot2
6+
suite: wrap
7+
description: Inspired by <a href="http://stackoverflow.com/questions/3311901/how-do-i-get-ggplot-to-order-facets-correctly">Stack Overflow</a>.
8+
order: 8
9+
sitemap: false
10+
---
11+
library(plotly)
12+
set.seed(123)
13+
14+
df <- diamonds[sample(1:nrow(diamonds), size = 1000), ]
15+
16+
# Reorer levels
17+
18+
levels(df$clarity) <- c("VS2", "VS1", "VVS2", "I1", "SI2", "IF", "VVS1", "SI1")
19+
20+
p <- ggplot(df, aes(carat, price)) +
21+
geom_point() +
22+
facet_wrap(~ clarity) +
23+
ggtitle("Diamonds dataset facetted by clarity")
24+
25+
ggplotly(p)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Change title in <code>facet_wrap</code>
3+
plot_url: https://plot.ly/~RPlotBot/2903/diamonds-dataset-facetted-by-clarity/
4+
arrangement: horizontal
5+
language: ggplot2
6+
suite: wrap
7+
description: Inspired by <a href="http://docs.ggplot2.org/current/">ggplot2 documentation</a>.
8+
order: 7
9+
sitemap: false
10+
---
11+
library(plotly)
12+
set.seed(123)
13+
14+
df <- diamonds[sample(1:nrow(diamonds), size = 1000), ]
15+
16+
# Create labels
17+
labs <- c("Best","Second best","Third best","Average", "Average","Third Worst","Second Worst","Worst")
18+
levels(df$clarity) <- rev(labs)
19+
20+
p <- ggplot(df, aes(carat, price)) +
21+
geom_point() +
22+
facet_wrap(~ clarity) +
23+
ggtitle("Diamonds dataset facetted by clarity")
24+
25+
ggplotly(p)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: ggplot2 <code>geom_tile</code>| Examples | Plotly
3+
name: geom_tile
4+
permalink: ggplot2/geom_tile/
5+
description: Use <code>geom_tile</code> to create heatmaps in R using ggplot2
6+
layout: base
7+
thumbnail: thumbnail/heatmap.jpg
8+
language: ggplot2
9+
page_type: example_index
10+
has_thumbnail: true
11+
display_as: basic
12+
---
13+
{% assign examples = site.posts | where:"language","ggplot2" | where:"suite","tile" | sort: "order" %}
14+
{% include auto_examples.html examples=examples %}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Displaying hierarchical clustering using <code>geom_tile</code>
3+
plot_url: https://plot.ly/~RPlotBot/2909/var2-vs-var1/
4+
arrangement: horizontal
5+
language: ggplot2
6+
suite: tile
7+
description: Inspired by <a href="http://stackoverflow.com/questions/25528059/cluster-data-in-heat-map-in-r-ggplot">Stack Overflow</a>.
8+
order: 2
9+
sitemap: false
10+
---
11+
library(plotly)
12+
library(reshape2)
13+
14+
# Do hierarchical clustering
15+
16+
clust <- volcano %>%
17+
dist() %>%
18+
hclust()
19+
20+
# Get order
21+
ord <- clust$order
22+
23+
# Re-arrange based on order
24+
df <- volcano[ord,]
25+
26+
# Plot
27+
p <- df %>%
28+
melt() %>%
29+
ggplot(aes(Var1, Var2, fill = value)) + geom_tile()
30+
31+
ggplotly(p)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Custom continuous color scale using <code>geom_tile</code>
3+
plot_url: https://plot.ly/~RPlotBot/2913/var2-vs-var1/
4+
arrangement: horizontal
5+
language: ggplot2
6+
suite: tile
7+
description: Inspired by <a href="http://docs.ggplot2.org/current/">ggplot2 documentation</a>.
8+
order: 3
9+
sitemap: false
10+
---
11+
library(plotly)
12+
library(reshape2)
13+
14+
p <- volcano %>%
15+
melt() %>%
16+
ggplot(aes(Var1, Var2, fill = value)) + geom_tile()
17+
18+
p <- plotly_build(p)
19+
20+
# Modify the plotly abject to add colorscale
21+
p$data[[1]]$colorscale = list(c(0, "#ffe6cc"), c(1, "#ff8400"))
22+
23+
ggplotly(p)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Using a matrix as input to <code>geom_tile</code>
3+
plot_url: https://plot.ly/~RPlotBot/2907/var2-vs-var1/
4+
arrangement: horizontal
5+
language: ggplot2
6+
suite: tile
7+
description: Inspired by <a href="http://docs.ggplot2.org/current/">ggplot2 documentation</a>.
8+
order: 1
9+
sitemap: false
10+
---
11+
library(plotly)
12+
library(reshape2)
13+
14+
p <- volcano %>%
15+
melt() %>%
16+
ggplot(aes(Var1, Var2, fill = value)) + geom_tile()
17+
18+
ggplotly(p)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Custom discrete color scale using <code>geom_tile</code>
3+
plot_url: https://plot.ly/~RPlotBot/2921/custom-discrete-colorscale/
4+
arrangement: horizontal
5+
language: ggplot2
6+
suite: tile
7+
description: Inspired by <a href="http://stackoverflow.com/questions/10981324/ggplot2-heatmap-with-colors-for-ranged-values">Stack Overflow</a>.
8+
order: 4
9+
sitemap: false
10+
---
11+
library(plotly)
12+
library(reshape2)
13+
library(RColorBrewer)
14+
15+
# Cut into factors
16+
levels <- cut(volcano, breaks = seq(min(volcano), max(volcano), by = 10), right = F)
17+
18+
# Convert into matrix
19+
df <- matrix(levels, nrow = nrow(volcano), byrow = F)
20+
nColor <- length(unique(levels))
21+
22+
# Plot
23+
p <- df %>%
24+
melt() %>%
25+
ggplot(aes(Var1, Var2, fill = value)) + geom_tile() +
26+
scale_fill_manual(values = brewer.pal(nColor, "Set3"))+
27+
ggtitle("Custom Discrete Colorscale")
28+
29+
ggplotly(p)
30+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Plot a Function of two variables
3+
plot_url: https://plot.ly/~tarzzz1/8
4+
arrangement: horizontal
5+
language: matlab
6+
suite: 3d-surface
7+
order: 2
8+
sitemap: false
9+
description: Inspired from <a href="http://in.mathworks.com/help/symbolic/ezsurf.html">Matlab Docs</a>.
10+
---
11+
% Learn about API authentication here: https://plot.ly/matlab/getting-started
12+
% Find your api_key here: https://plot.ly/settings/api
13+
14+
f = @(x, y) real(atan(x + i*y));
15+
ezsurf(f);
16+
title('Function of two variables');
17+
18+
response = fig2plotly;
19+
plotly_url = response.url;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Plot a 3d Implicit Function
3+
plot_url: https://plot.ly/~tarzzz/1584/
4+
arrangement: horizontal
5+
language: matlab
6+
suite: 3d-surface
7+
order: 3
8+
sitemap: false
9+
---
10+
% Learn about API authentication here: https://plot.ly/matlab/getting-started
11+
% Find your api_key here: https://plot.ly/settings/api
12+
13+
z = 0:4*pi; % <-- Or whatever range you want for z
14+
t = 0:2*pi;
15+
[Z,T] = meshgrid(z,t);
16+
X = sin(Z).*cos(T);
17+
Y = sin(Z).*sin(T);
18+
19+
surf(X,Y,Z)
20+
response = fig2plotly;
21+
plotly_url = response.url;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Matlab Enable Data Cursor
3+
plot_url: https://plot.ly/~tarzzz/1837
4+
arrangement: horizontal
5+
language: matlab
6+
suite: annotations
7+
order: 2
8+
sitemap: false
9+
---
10+
% Learn about API authentication here: https://plot.ly/matlab/getting-started
11+
% Find your api_key here: https://plot.ly/settings/api
12+
13+
x = 1:10:100
14+
fig = figure;
15+
plot(x, (x+1).^2, 'bo','markers',14)
16+
title('hover over the markers to see the coordinates');
17+
response = fig2plotly(fig, 'strip',false);
18+
19+
data = cell2struct(data,'data',1);
20+
data.mode = 'markers+text'; % Able the data cursor
21+
22+
response2 = plotly(data, response.layout);
23+
plotly_url = response2.url;

_posts/matlab/axes/2015-04-09-axes-range-manual.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Setting the Range of Axes Manually
2+
name: Setting the Range of Axes Manually ( Axis Scaling )
33
plot_url: https://plot.ly/~PlotBot/9
44
arrangement: horizontal
55
language: matlab
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Customize Grid Spacing, Size and Color
3+
plot_url: https://plot.ly/~tarzzz/1546
4+
arrangement: horizontal
5+
language: matlab
6+
suite: axes
7+
order: 3
8+
sitemap: false
9+
---
10+
% Learn about API authentication here: https://plot.ly/matlab/getting-started
11+
% Find your api_key here: https://plot.ly/settings/api
12+
13+
plot(1:100,'FaceColor','green');
14+
title('Customizing grid color, spacing and size');
15+
response = fig2plotly;
16+
17+
% Grid Size
18+
response.layout.xaxis1.range = [0 100];
19+
response.layout.yaxis1.range = [0 100];
20+
21+
% Grid Color
22+
response.layout.xaxis1.gridcolor = 'rgb(159, 197, 232)';
23+
response.layout.yaxis1.gridcolor = 'rgb(159, 197, 232)';
24+
25+
% Axis Color
26+
response.layout.xaxis1.zerolinecolor = 'rgb(74, 134, 232)';
27+
response.layout.yaxis1.zerolinecolor = 'rgb(74, 134, 232)';
28+
29+
% Grid Spacing
30+
response.layout.xaxis1.dtick = 25;
31+
response.layout.yaxis1.dtick = 25;
32+
33+
response2 = plotly(response.data, struct('layout',response.layout));
34+
plotly_url = response2.url;

0 commit comments

Comments
 (0)