Skip to content

Commit 817a0f2

Browse files
Merge branch 'doc-prod'
2 parents 0e77150 + a13d3fa commit 817a0f2

File tree

6 files changed

+31
-5
lines changed

6 files changed

+31
-5
lines changed

Diff for: doc/python/click-events.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jupyter:
2727
language: python
2828
layout: base
2929
name: Click Events
30-
order: 24
30+
order: 4
3131
page_type: example_index
3232
permalink: python/click-events/
3333
thumbnail: thumbnail/figurewidget-click-events.gif

Diff for: doc/python/figurewidget-app.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jupyter:
2727
language: python
2828
layout: base
2929
name: Interactive Data Analysis with FigureWidget ipywidgets
30-
order: 23
30+
order: 3
3131
page_type: example_index
3232
permalink: python/figurewidget-app/
3333
thumbnail: thumbnail/multi-widget.jpg

Diff for: doc/python/figurewidget.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jupyter:
2727
language: python
2828
layout: base
2929
name: Plotly FigureWidget Overview
30-
order: 0
30+
order: 1
3131
page_type: example_index
3232
permalink: python/figurewidget/
3333
thumbnail: thumbnail/figurewidget-overview.gif

Diff for: doc/python/random-walk.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jupyter:
2828
language: python
2929
layout: base
3030
name: Random Walk
31-
order: 10
31+
order: 2
3232
page_type: example_index
3333
permalink: python/random-walk/
3434
thumbnail: /images/static-image

Diff for: doc/python/smoothing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jupyter:
2828
language: python
2929
layout: base
3030
name: Smoothing
31-
order: 1
31+
order: 4
3232
page_type: example_index
3333
permalink: python/smoothing/
3434
thumbnail: /images/static-image

Diff for: doc/python/static-image-export.md

+26
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,32 @@ fig.write_image("images/fig1.eps")
157157

158158
**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.
159159

160+
<!-- #region -->
161+
### Install orca on Google Colab
162+
```
163+
!pip install plotly>=4.7.1
164+
!wget https://github.com/plotly/orca/releases/download/v1.2.1/orca-1.2.1-x86_64.AppImage -O /usr/local/bin/orca
165+
!chmod +x /usr/local/bin/orca
166+
!apt-get install xvfb libgtk2.0-0 libgconf-2-4
167+
```
168+
169+
Once this is done you can use this code to make, show and export a figure:
170+
171+
```python
172+
import plotly.graph_objects as go
173+
fig = go.Figure( go.Scatter(x=[1,2,3], y=[1,3,2] ) )
174+
fig.write_image("fig1.svg")
175+
fig.write_image("fig1.png")
176+
```
177+
178+
The files can then be downloaded with:
179+
180+
```python
181+
from google.colab import files
182+
files.download('fig1.svg')
183+
files.download('fig1.png')
184+
```
185+
<!-- #endregion -->
160186

161187
### Get Image as Bytes
162188
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.

0 commit comments

Comments
 (0)