spatialdata-plot icon indicating copy to clipboard operation
spatialdata-plot copied to clipboard

Different outline linewidths between matplotlib and datashader

Open Sonja-Stockhaus opened this issue 2 months ago • 0 comments

In datashader, linewidths are given in pixels, e.g. to Canvas.line(), while matplotlib measures linewidths in points. This leads to differences in the plotting results that are bigger the larger the linewidth value. Example:

import spatialdata_plot
from spatialdata.datasets import blobs
blob = blobs()

blob.pl.render_shapes("blobs_circles", outline_width=20).pl.show()

gives Image

whereas

blob.pl.render_shapes("blobs_circles", outline_width=20, method="datashader").pl.show()

gives

Image

Would be good if the value passed to datashader would be normalized at some point so that the result would be closer to matplotlib.

Sonja-Stockhaus avatar Sep 25 '25 14:09 Sonja-Stockhaus