You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python/performance.md
+83-1
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,9 @@ jupyter:
30
30
name: High Performance Visualization
31
31
order: 14
32
32
permalink: python/performance/
33
-
redirect_from: python/webgl-vs-svg/
33
+
redirect_from:
34
+
- python/webgl-vs-svg/
35
+
- python/datashader/
34
36
thumbnail: thumbnail/webgl.jpg
35
37
---
36
38
@@ -152,6 +154,8 @@ See https://plotly.com/python/reference/scattergl/ for more information and char
152
154
153
155
## NumPy and NumPy Convertible Arrays for Improved Performance
154
156
157
+
*New in Plotly.py version 6*
158
+
155
159
Improve the performance of generating Plotly figures that use a large number of data points by using NumPy arrays and other objects that Plotly can convert to NumPy arrays, such as Pandas and Polars Series.
156
160
157
161
Plotly.py uses Plotly.js for rendering, which supports typed arrays. In Plotly.py, NumPy array and NumPy-convertible arrays are base64 encoded before being passed to Plotly.js for rendering.
Use [Datashader](https://datashader.org/) to reduce the size of a dataset passed to the browser for rendering by creating a rasterized representation of the dataset. This makes it ideal for working with datasets of tens to hundreds of millions of points.
225
+
226
+
### Passing Datashader Rasters as a Tile Map Image Layer
227
+
228
+
We visualize here the spatial distribution of taxi rides in New York City. A higher density
229
+
is observed on major avenues. For more details about tile-based maps, see [the tile map layers tutorial](/python/tile-map-layers).
Here we explore the flight delay dataset from https://www.kaggle.com/usdot/flight-delays. In order to get a visual impression of the correlation between features, we generate a datashader rasterized array which we plot using a `Heatmap` trace. It creates a much clearer visualization than a scatter plot of (even a fraction of) the data points, as shown below.
Instead of using Datashader, it would theoretically be possible to create a [2d histogram](/python/2d-histogram-contour/) with Plotly, but this is not recommended because you would need to load the whole dataset of around 5M rows in the browser for plotly.js to compute the heatmap.
0 commit comments