Skip to content

Cookbook: add recipe showing frameless heatmap #3828

@itsmygam3

Description

@itsmygam3

Question: For further processing, I need to save the heatmap plot as an image, but when trying to save, white fields are always formed at the edges. How can I fix the code so that I can get an image containing only a graph of a heatmap without extraneous elements?

UPD. At the moment, I found out that the DataBackground field from BackgroundStyle class is responsible for this frame. I was able to change its color, but I need to completely exclude it.
image

ScottPlot Version: 5.0.34

Code Sample:

double[,] data = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };

formsPlot1.Plot.HideGrid();
formsPlot1.Plot.Layout.Frameless();
formsPlot1.Plot.Add.Heatmap(data);
formsPlot1.Plot.SaveJpeg("bord.jpg", 400, 400);

panel1.Controls.Add(formsPlot1);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help WantedScott won't do this soon, but PRs from the community are welcome!⚠️ HIGH PRIORITY

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions