Skip to content

MultiPlot in notebooks without system.drawing #3781

Closed Answered by yueyinqiu
yueyinqiu asked this question in Questions
Discussion options

You must be logged in to vote

Oh I just realized that ScottPlot relies on SkiaSharp. I can use it without any burden now.

    public static SKBitmap ToSKBitmap(this IEnumerable<Plot> plots,
        int columnCount, int plotWidth, int plotHeight)
    {
        var plotsArray = plots.ToArray();

        var height = (plotsArray.Length + columnCount - 1) / columnCount * plotHeight;
        var width = plotWidth * columnCount;

        var bitmap = new SKBitmap(width, height);
        using var canvas = new SKCanvas(bitmap);

        var left = 0;
        var top = 0;
        foreach (var plot in plots)
        {
            using SKSurface surface = SKSurface.Create(new SKImageInfo(plotWidth, plotHeight));
            plot.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yueyinqiu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant