Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ヒートマップの矩形

ヒートマップの寸法は、ヒートマップがその内部にレンダリングされる矩形を定義することで設定できます。

Heatmap.cs
ScottPlot.Plot myPlot = new();

// 任意のサイズのヒートマップを作成する
double[,] data = {
    { 1, 2, 3 },
    { 4, 5, 6 },
    { 7, 8, 9 },
};

// ヒートマップをプロットに追加する
var hm = myPlot.Add.Heatmap(data);

// 座標空間で定義された矩形内にヒートマップを配置する
hm.Rectangle = new CoordinateRect(-5, 5, -5, 5);

myPlot.SavePng("demo.png", 400, 300);
このレシピは、ヒートマップカテゴリにある多数のレシピの 1 つです