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

Skip to content

Commit 3b8c0d1

Browse files
author
Joseph Damiba
authored
Merge pull request #1663 from plotly/update-r-chart-studio-docs
update copy on r/chart-studio docs
2 parents 0867bfa + 199e159 commit 3b8c0d1

21 files changed

+535
-508
lines changed

_posts/python-v3/chart-studio/get-requests/2015-04-09-get-requests_python_index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
name: Get Requests
3-
permalink: python/v3/get-requests/
4-
description: How to download plotly users's public graphs and data with python.
2+
name: Working With Chart Studio Graphs
3+
permalink: python/v3/working-with-chart-studio-graphs/
4+
redirect_from:
5+
- python/v3/get-requests/
6+
description: How to download Chart Studio users' public graphs and data with Python.
57
layout: base
68
thumbnail: thumbnail/get-requests.jpg
79
language: python/v3

_posts/python/chart-studio/2019-07-03-get-requests.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2-
description: How to download plotly users's public graphs and data with python.
2+
description: How to download Chart Studio users' public graphs and data into Python.
33
display_as: chart_studio
44
language: python
55
layout: base
6-
name: Get Requests
6+
name: Working With Chart Studio Graphs
77
order: 8
8-
permalink: python/get-requests/
8+
permalink: python/working-with-chart-studio-graphs/
9+
redirect_from: python/get-requests
910
thumbnail: thumbnail/spectral.jpg
1011
v4upgrade: True
1112
---
Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
2-
description: How to export plotly graphs as static images in R. Plotly supports png,
3-
svg, jpg, and pdf image export.
2+
description: How to export R graphs as static images using Chart Studio.
43
display_as: chart_studio
54
language: r
65
layout: base
7-
name: Static Image Export
6+
name: Exporting Graphs As Static Images Using Chart Studio
87
order: 2
98
output:
109
html_document:
1110
keep_md: true
1211
page_type: example_index
13-
permalink: r/static-image-export/
12+
permalink: r/chart-studio-image-export/
1413
sitemap: false
1514
thumbnail: thumbnail/png-export.png
1615
---
@@ -20,64 +19,42 @@ knitr::opts_chunk$set(message = FALSE, warning=FALSE)
2019
Sys.setenv("plotly_username"="RPlotBot")
2120
Sys.setenv("plotly_api_key"="q0lz6r5efr")
2221
```
22+
### Supported File Formats
2323

24-
### New to Plotly?
24+
With the `plotly` R package, you can export graphs you create as static images in the `.png` and/or `.jpg`/`.jpeg` file formats for free using the [Chart Studio web service](https://chart-studio.plot.ly/create/#/).
2525

26-
Plotly's R library is free and open source!<br>
27-
[Get started](https://plot.ly/r/getting-started/) by downloading the client and [reading the primer](https://plot.ly/r/getting-started/).<br>
28-
You can set up Plotly to work in [online](https://plot.ly/r/getting-started/#hosting-graphs-in-your-online-plotly-account) or [offline](https://plot.ly/r/offline/) mode.<br>
29-
We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/r_cheat_sheet.pdf) (new!) to help you get started!
26+
Currently, exporting graphs you create as static images in the `.eps`, `.svg`, and/or `.pdf` format is a feature that is available only to users of [Chart Studio Enterprise](https://plot.ly/online-chart-maker/).
3027

31-
### Version Check
28+
**Note:** It is important to be aware that R graphs containing WebGL-based traces (i.e. of type `scattergl`, `heatmapgl`, `contourgl`, `scatter3d`, `surface`, `mesh3d`, `scatterpolargl`, `cone`, `streamtube`, `splom`, and/or `parcoords`) will include encapsulated rasters instead of vectors for some parts of the image if they are exported as static images in a vector format like `.eps`, `.svg`, and/or `.pdf`.
3229

33-
Version 4 of Plotly's R package is now [available](https://plot.ly/r/getting-started/#installation)!<br>
34-
Check out [this post](http://moderndata.plot.ly/upgrading-to-plotly-4-0-and-above/) for more information on breaking changes and new features available in this version.
30+
### Exporting Chart Studio Charts As Static Images
3531

36-
```{r}
37-
library(plotly)
38-
packageVersion('plotly')
39-
```
40-
41-
### Supported Formats
42-
43-
The common image formats: 'PNG', 'JPG/JPEG' are supported. In addition, formats like 'EPS', 'SVG' and 'PDF' are also available for user with a Personal or Professional subscription. You can get more details on our [pricing page] (https://plot.ly/products/cloud/)
44-
45-
**Note:** It is important to note that any figures containing WebGL traces (i.e. of type scattergl, heatmapgl, contourgl, scatter3d, surface, mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that are exported in a vector format like SVG, EPS or PDF will include encapsulated rasters instead of vectors for some parts of the image.
32+
To export your R graphs as static images using the Chart Studio web service, you can use the built-in `plotly_IMAGE()` function.
4633

47-
To access the image in a particular format, you can either:
34+
#### Create A Chart Studio Account And Get An API Key
4835

36+
To use the `plotly_IMAGE()` function, you will need to have a [Chart Studio account](https://chart-studio.plot.ly/Auth/login/?action=signup#/) and an API key (which can be found [in your Chart Studio account online settings](https://plot.ly/settings/api)). Learn more about [getting started with Chart Studio in R](https://plot.ly/r/getting-started-with-chart-studio).
4937

50-
* use the `orca()` function. [Orca](https://github.com/plotly/orca) is Plotly's command line applications for generating static images.
38+
#### Set Environment Variables In Your R Session
5139

52-
* export the image on plotly's servers using `plotly_IMAGE()`.
53-
54-
* append the format extension to the plot url. i.e. the JPG version of the plot: https://plot.ly/~chris/1638 is available at : https://plot.ly/~chris/1638.jpg.
55-
56-
### Export Locally
57-
58-
`4.7.900` and above includes the `orca()` function (replacing the `export()` function), which exports images locally, but requires the processx package:
40+
Let the R session know about your Chart Studio authorization credentials by setting environment variables using [`Sys.setenv()`](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/Sys.setenv).
5941

6042
```{r, eval = FALSE}
61-
if (!require("processx")) install.packages("processx")
62-
63-
p <- plot_ly(z = ~volcano) %>% add_surface()
64-
65-
orca(p, "surface-plot.svg")
43+
Sys.setenv("plotly_username" = "YOUR USER NAME")
44+
Sys.setenv("plotly_api_key" = "YOUR API KEY")
6645
```
6746

68-
### Export Using Your Plotly Account
69-
70-
Another option is to do image export through your plotly account.
47+
#### Use The Development Version Of The `plotly` R Package
7148

72-
First, you will require the development version of plotly, this can be installed using `devtools::install_github("ropensci/plotly")`. In addition, if you haven't already, let the R package know about your credentials.
49+
You will also need to be using the development version of the `plotly` R package in order to use the `plotly_IMAGE()` function. This can be installed from GitHub using the [`devtools`](https://cran.r-project.org/web/packages/devtools/index.html) R package by running the following command in your R session:
7350

74-
75-
```{r, eval = FALSE}
76-
Sys.setenv("plotly_username" = "YOUR USER NAME")
77-
Sys.setenv("plotly_api_key" = "YOUR API KEY")
51+
```r
52+
devtools::install_github("ropensci/plotly")
7853
```
7954

80-
This option will export the image on plotly's servers and write the content to a local file `"output.png"` in your working directory.
55+
#### Export R Graph As Static Image
56+
57+
The `plotly_IMAGE()` function exports your R plots as static images using the Chart Studio web service. The image will be stored in a file in the working directory of your R session.
8158

8259
```{r}
8360
library(plotly)
@@ -87,7 +64,12 @@ plotly_IMAGE(p, format = "png", out_file = "output.png")
8764

8865
![](https://images.plot.ly/plotly-documentation/images/output.png)
8966

90-
### Appending File Type to URL
67+
### Alternative Methods Of Exporting Graphs As Static Images In R
68+
69+
#### Local Image Export
70+
71+
As an alternative to using the Chart Studio web service to export your R graphs as static images, you can [use the built-in `orca()` function](https://plot.ly/r/static-image-export) to export images locally.
72+
73+
#### Embed R Charts in RMarkdown Documents
9174

92-
You can also view the static version of any Plotly graph by appending `.png`,
93-
`.pdf`, `.eps`, or `.svg` to the end of the URL. For example, view the static image of <https://plot.ly/~chris/1638> at <https://plot.ly/~chris/1638.png>. See [Using Plotly with rmarkdown/knitr](https://plot.ly/r/knitr/) for a way to embed these links in rmarkdown/knitr (Rmd) files.
75+
See [Embedding Graphs in RMarkdown](https://plot.ly/r/embedding-graphs-in-rmarkdown/) to learn more about embedding R charts in RMarkdown (.Rmd) files.
Lines changed: 29 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,57 @@
11
---
2-
description: How to export plotly graphs as static images in R. Plotly supports png,
3-
svg, jpg, and pdf image export.
2+
description: How to export R graphs as static images using Chart Studio.
43
display_as: chart_studio
54
language: r
65
layout: base
7-
name: Static Image Export
6+
name: Exporting Graphs As Static Images Using Chart Studio
87
order: 2
98
output:
109
html_document:
1110
keep_md: true
1211
page_type: example_index
13-
permalink: r/static-image-export/
12+
permalink: r/chart-studio-image-export/
1413
sitemap: false
1514
thumbnail: thumbnail/png-export.png
1615
---
1716

18-
### New to Plotly?
1917

20-
Plotly's R library is free and open source!<br>
21-
[Get started](https://plot.ly/r/getting-started/) by downloading the client and [reading the primer](https://plot.ly/r/getting-started/).<br>
22-
You can set up Plotly to work in [online](https://plot.ly/r/getting-started/#hosting-graphs-in-your-online-plotly-account) or [offline](https://plot.ly/r/offline/) mode.<br>
23-
We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/r_cheat_sheet.pdf) (new!) to help you get started!
18+
### Supported File Formats
2419

25-
### Version Check
20+
With the `plotly` R package, you can export graphs you create as static images in the `.png` and/or `.jpg`/`.jpeg` file formats for free using the [Chart Studio web service](https://chart-studio.plot.ly/create/#/).
2621

27-
Version 4 of Plotly's R package is now [available](https://plot.ly/r/getting-started/#installation)!<br>
28-
Check out [this post](http://moderndata.plot.ly/upgrading-to-plotly-4-0-and-above/) for more information on breaking changes and new features available in this version.
22+
Currently, exporting graphs you create as static images in the `.eps`, `.svg`, and/or `.pdf` format is a feature that is available only to users of [Chart Studio Enterprise](https://plot.ly/online-chart-maker/).
2923

24+
**Note:** It is important to be aware that R graphs containing WebGL-based traces (i.e. of type `scattergl`, `heatmapgl`, `contourgl`, `scatter3d`, `surface`, `mesh3d`, `scatterpolargl`, `cone`, `streamtube`, `splom`, and/or `parcoords`) will include encapsulated rasters instead of vectors for some parts of the image if they are exported as static images in a vector format like `.eps`, `.svg`, and/or `.pdf`.
3025

31-
```r
32-
library(plotly)
33-
packageVersion('plotly')
34-
```
35-
36-
```
37-
## [1] '4.5.6.9000'
38-
```
26+
### Exporting Chart Studio Charts As Static Images
3927

40-
### Supported Formats
28+
To export your R graphs as static images using the Chart Studio web service, you can use the built-in `plotly_IMAGE()` function.
4129

42-
The common image formats: 'PNG', 'JPG/JPEG' are supported. In addition, formats like 'EPS', 'SVG' and 'PDF' are also available for user with a Personal or Professional subscription. You can get more details on our [pricing page] (https://plot.ly/products/cloud/)
30+
#### Create A Chart Studio Account And Get An API Key
4331

44-
**Note:** It is important to note that any figures containing WebGL traces (i.e. of type scattergl, heatmapgl, contourgl, scatter3d, surface, mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that are exported in a vector format like SVG, EPS or PDF will include encapsulated rasters instead of vectors for some parts of the image.
32+
To use the `plotly_IMAGE()` function, you will need to have a [Chart Studio account](https://chart-studio.plot.ly/Auth/login/?action=signup#/) and an API key (which can be found [in your Chart Studio account online settings](https://plot.ly/settings/api)). Learn more about [getting started with Chart Studio in R](https://plot.ly/r/getting-started-with-chart-studio).
4533

46-
To access the image in a particular format, you can either:
34+
#### Set Environment Variables In Your R Session
4735

48-
49-
* use the `orca()` function. [Orca](https://github.com/plotly/orca) is Plotly's command line applications for generating static images.
50-
51-
* export the image on plotly's servers using `plotly_IMAGE()`.
52-
53-
* append the format extension to the plot url. i.e. the JPG version of the plot: https://plot.ly/~chris/1638 is available at : https://plot.ly/~chris/1638.jpg.
54-
55-
### Export Locally
56-
57-
`4.7.900` and above includes the `orca()` function (replacing the `export()` function), which exports images locally, but requires the processx package:
36+
Let the R session know about your Chart Studio authorization credentials by setting environment variables using [`Sys.setenv()`](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/Sys.setenv).
5837

5938

6039
```r
61-
if (!require("processx")) install.packages("processx")
62-
63-
p <- plot_ly(z = ~volcano) %>% add_surface()
64-
65-
orca(p, "surface-plot.png")
40+
Sys.setenv("plotly_username" = "YOUR USER NAME")
41+
Sys.setenv("plotly_api_key" = "YOUR API KEY")
6642
```
6743

68-
### Export Using Your Plotly Account
69-
70-
Another option is to do image export through your plotly account.
71-
72-
First, you will require the development version of plotly, this can be installed using `devtools::install_github("ropensci/plotly")`. In addition, if you haven't already, let the R package know about your credentials.
73-
44+
#### Use The Development Version Of The `plotly` R Package
7445

46+
You will also need to be using the development version of the `plotly` R package in order to use the `plotly_IMAGE()` function. This can be installed from GitHub using the [`devtools`](https://cran.r-project.org/web/packages/devtools/index.html) R package by running the following command in your R session:
7547

7648
```r
77-
Sys.setenv("plotly_username" = "YOUR USER NAME")
78-
Sys.setenv("plotly_api_key" = "YOUR API KEY")
49+
devtools::install_github("ropensci/plotly")
7950
```
8051

81-
This option will export the image on plotly's servers and write the content to a local file `"output.png"` in your working directory.
52+
#### Export R Graph As Static Image
53+
54+
The `plotly_IMAGE()` function exports your R plots as static images using the Chart Studio web service. The image will be stored in a file in the working directory of your R session.
8255

8356

8457
```r
@@ -89,7 +62,12 @@ plotly_IMAGE(p, format = "png", out_file = "output.png")
8962

9063
![](https://images.plot.ly/plotly-documentation/images/output.png)
9164

92-
### Appending File Type to URL
65+
### Alternative Methods Of Exporting Graphs As Static Images In R
66+
67+
#### Local Image Export
68+
69+
As an alternative to using the Chart Studio web service to export your R graphs as static images, you can [use the built-in `orca()` function](https://plot.ly/r/static-image-export) to export images locally.
70+
71+
#### Embed R Charts in RMarkdown Documents
9372

94-
You can also view the static version of any Plotly graph by appending `.png`,
95-
`.pdf`, `.eps`, or `.svg` to the end of the URL. For example, view the static image of <https://plot.ly/~chris/1638> at <https://plot.ly/~chris/1638.png>. See [Using Plotly with rmarkdown/knitr](https://plot.ly/r/knitr/) for a way to embed these links in rmarkdown/knitr (Rmd) files.
73+
See [Embedding Graphs in RMarkdown](https://plot.ly/r/embedding-graphs-in-rmarkdown/) to learn more about embedding R charts in RMarkdown (.Rmd) files.
Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
description: R Filenames, folders, and updating Plotly graphs in the plotly cloud.
2+
description: How to update graphs stored in Chart Studio with R.
33
display_as: chart_studio
44
language: r
55
layout: base
6-
name: Updating Plotly Graphs
7-
order: 1
6+
name: Updating Graphs Stored In Chart Studio
7+
order: 9
88
output:
99
html_document:
1010
keep_md: true
@@ -18,44 +18,36 @@ knitr::opts_chunk$set(message = FALSE, warning=FALSE)
1818
Sys.setenv("plotly_username"="RPlotBot")
1919
Sys.setenv("plotly_api_key"="q0lz6r5efr")
2020
```
21-
### New to Plotly?
21+
### Save R Plot To Chart Studio
2222

23-
Plotly's R library is free and open source!<br>
24-
[Get started](https://plot.ly/r/getting-started/) by downloading the client and [reading the primer](https://plot.ly/r/getting-started/).<br>
25-
You can set up Plotly to work in [online](https://plot.ly/r/getting-started/#hosting-graphs-in-your-online-plotly-account) or [offline](https://plot.ly/r/offline/) mode.<br>
26-
We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/r_cheat_sheet.pdf) (new!) to help you get started!
27-
28-
### Version Check
29-
30-
Version 4 of Plotly's R package is now [available](https://plot.ly/r/getting-started/#installation)!<br>
31-
Check out [this post](http://moderndata.plot.ly/upgrading-to-plotly-4-0-and-above/) for more information on breaking changes and new features available in this version.
32-
```{r}
33-
library(plotly)
34-
packageVersion('plotly')
35-
```
36-
37-
#### Save Plot to Server
38-
To create a plotly figure on a plotly server, use `api_create()`.
23+
Using the `plotly` R package, you can create a Chart Studio figure based on your R chart. Simply pass your chart as a parameter to the `api_create()` function:
3924

4025
```{r}
4126
library(plotly)
42-
p <- plot_ly(x = c(1, 2), y = c(1, 2))
27+
p <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length)
4328
api_create(p)
4429
```
4530

46-
#### Overwrite Plot
31+
### How To Overwrite An Existing Plot
32+
33+
By default, when you call `api_create()`, a new plot is created in your Chart Studio account with its own unique URL.
4734

48-
If you don't include a filename, a new plot will be made on your online plotly account. If you want to overwrite a plot (i.e., keep the graph served from the same plotly URL), specify a filename. This implicitly overwrites your plotly graph.
35+
If you would like to overwrite an existing plot in your Chart Studio account and keep the same URL, then supply a `filename` as an extra parameter to the `api_create()` function. This will keep the same URL for the plot.
4936

5037
```{r}
5138
api_create(p, filename = "name-of-my-plotly-file")
5239
```
5340

54-
#### Save your Plot in a Folder
55-
If the filename contains "/", it will automatically create a plotly folder. This option is only available for [Pro-Subscriptions](https://plot.ly/products/cloud/)
41+
### Saving Plots In Folders
42+
43+
If the `filename` parameter contains the character "/", then the `api_create()` function will save that plot in a folder in your Chart Studio account.
44+
45+
This option is only available for [Chart Studio Enterprise subscribers](https://plot.ly/online-chart-maker/)
5646

5747
```{r}
58-
api_create(p, filename="r-docs-name-of-my-plotly-file")
48+
api_create(p, filename="r-docs/name-of-my-chart-studio-file")
5949
```
6050

61-
View your Plotly graphs at [https://plot.ly/organize](https://plot.ly/organize).
51+
### Viewing Saved Plots
52+
53+
View the R graphs you have saved in your Chart Studio account at [https://plot.ly/organize](https://plot.ly/organize).

0 commit comments

Comments
 (0)