When I export a scatterplot with 10000 datapoints to svg with fig.write_image("filename.svg")
as
1500 points
1000 points
(I had to make screenshots since stackoverflow does not allow .svg images)
CodePudding user response:
It looks just fine on my desktop with 10000 points: Is it possible that you have a graphic card issue?
CodePudding user response:
I believe the answer lies here in the plotly documentation for px.scatter
...
render_mode (str) – One of 'auto', 'svg' or 'webgl', default 'auto' Controls the browser API used to draw marks. 'svg’ is appropriate for figures of less than 1000 data points, and will allow for fully-vectorized output. 'webgl' is likely necessary for acceptable performance above 1000 points but rasterizes part of the output. 'auto' uses heuristics to choose the mode.
If you add render_mode = 'svg'
you should see this pixilation go away.
fig =px.scatter(df, x='X', y='Y', render_mode = 'svg')