Skip to content

Different outline linewidths between matplotlib and datashader #493

@Sonja-Stockhaus

Description

@Sonja-Stockhaus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingshapes 🫧Anything related to Shapes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions