Skip to content

Heatmap: add support for transparent cells #3349

@waacton

Description

@waacton

ScottPlot Version: 5.0.21

Question: Can a polygon be used as a mask?

I'm using ScottPlot to demonstrate how my colour library can be used with ScottPlot to generate the classic CIE xy chromaticity diagram, which was much easier than I expected 🎉

xy-plot-without-imaginary

My approach is brute force: convert every coordinate inside that black boundary to an RGB colour and draw a line around it, and that works fine. The only downside is that it's expensive to calculate if a coordinate is within that black boundary or not. My library will support it but it takes a couple of minutes for a million points.

For demonstration purposes, it would be a lot quicker for me to plot all points and then use the black boundary polygon as a mask, with everything outside the boundary removed. Is this possible?

xy-plot-with-imaginary

I'm not even sure if it's something that a plotting library should support, but thought it was worth asking in case I missed something!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions