绘图仪:注释
图形注释
注释是放置在图形上X/Y位置的标签(不是数据区域的坐标)。与文字绘图仪不同,注释不会随着轴的调整而移动。
var plt = new ScottPlot.Plot(600, 400);
double[] xs = DataGen.Range(0, 5, .1);
plt.AddScatter(xs, DataGen.Sin(xs));
plt.AddScatter(xs, DataGen.Cos(xs));
// default placement is upper left
plt.AddAnnotation("Top Left", 10, 10);
// negative coordinates can be used to place text along different edges
plt.AddAnnotation("Lower Left", 10, -10);
plt.AddAnnotation("Top Right", -10, 10);
plt.AddAnnotation("Lower Right", -10, -10);
// Additional customizations are available
var fancy = plt.AddAnnotation("Fancy Annotation", 10, 40);
fancy.Font.Size = 24;
fancy.Font.Name = "Impact";
fancy.Font.Color = Color.Red;
fancy.Shadow = false;
fancy.BackgroundColor = Color.FromArgb(25, Color.Blue);
fancy.BorderWidth = 2;
fancy.BorderColor = Color.Magenta;
plt.SaveFig("annotation_quickstart.png");