極座標軸のスタイリング
極座標軸の線は幅広くスタイル設定できます。極座標軸には、放射状のスポーク(原点から最大半径まで伸びる直線)と円形の軸線(原点を中心とする同心円)があります。
ScottPlot.Plot myPlot = new();
var polarAxis = myPlot.Add.PolarAxis();
// スポーク(回転を示すために中心から伸びる直線)をスタイル設定する
var radialPalette = new ScottPlot.Palettes.Category10();
for (int i = 0; i < polarAxis.Spokes.Count; i++)
{
polarAxis.Spokes[i].LineColor = radialPalette.GetColor(i).WithAlpha(.5);
polarAxis.Spokes[i].LineWidth = 4;
polarAxis.Spokes[i].LabelStyle.ForeColor = radialPalette.GetColor(i);
polarAxis.Spokes[i].LabelStyle.FontSize = 16;
polarAxis.Spokes[i].LabelStyle.Bold = true;
}
// 円(半径位置を示す同心円)をスタイル設定する
var circularColormap = new ScottPlot.Colormaps.Rain();
for (int i = 0; i < polarAxis.Circles.Count; i++)
{
double fraction = (double)i / (polarAxis.Circles.Count - 1);
polarAxis.Circles[i].LineColor = circularColormap.GetColor(fraction).WithAlpha(.5);
polarAxis.Circles[i].LineWidth = 2;
polarAxis.Circles[i].LinePattern = LinePattern.Dashed;
}
myPlot.SavePng("demo.png", 400, 300);
このレシピは、極座標軸カテゴリにある多数のレシピのうちの1つです
