Skip to content

Commit

Permalink
Merge branch 'doc-prod'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaskruchten committed May 22, 2020
2 parents 0e77150 + a13d3fa commit 817a0f2
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/python/click-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Click Events
order: 24
order: 4
page_type: example_index
permalink: python/click-events/
thumbnail: thumbnail/figurewidget-click-events.gif
Expand Down
2 changes: 1 addition & 1 deletion doc/python/figurewidget-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Interactive Data Analysis with FigureWidget ipywidgets
order: 23
order: 3
page_type: example_index
permalink: python/figurewidget-app/
thumbnail: thumbnail/multi-widget.jpg
Expand Down
2 changes: 1 addition & 1 deletion doc/python/figurewidget.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jupyter:
language: python
layout: base
name: Plotly FigureWidget Overview
order: 0
order: 1
page_type: example_index
permalink: python/figurewidget/
thumbnail: thumbnail/figurewidget-overview.gif
Expand Down
2 changes: 1 addition & 1 deletion doc/python/random-walk.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Random Walk
order: 10
order: 2
page_type: example_index
permalink: python/random-walk/
thumbnail: /images/static-image
Expand Down
2 changes: 1 addition & 1 deletion doc/python/smoothing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jupyter:
language: python
layout: base
name: Smoothing
order: 1
order: 4
page_type: example_index
permalink: python/smoothing/
thumbnail: /images/static-image
Expand Down
26 changes: 26 additions & 0 deletions doc/python/static-image-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,32 @@ fig.write_image("images/fig1.eps")

**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 will include encapsulated rasters, instead of vectors, for some parts of the image.

<!-- #region -->
### Install orca on Google Colab
```
!pip install plotly>=4.7.1
!wget https://github.com/plotly/orca/releases/download/v1.2.1/orca-1.2.1-x86_64.AppImage -O /usr/local/bin/orca
!chmod +x /usr/local/bin/orca
!apt-get install xvfb libgtk2.0-0 libgconf-2-4
```

Once this is done you can use this code to make, show and export a figure:

```python
import plotly.graph_objects as go
fig = go.Figure( go.Scatter(x=[1,2,3], y=[1,3,2] ) )
fig.write_image("fig1.svg")
fig.write_image("fig1.png")
```

The files can then be downloaded with:

```python
from google.colab import files
files.download('fig1.svg')
files.download('fig1.png')
```
<!-- #endregion -->

### Get Image as Bytes
The `plotly.io.to_image` function is used to return an image as a bytes object. You can also use the `.to_image` graph object figure method.
Expand Down

0 comments on commit 817a0f2

Please sign in to comment.