什么是ScottPlot.WPF?
ScottPlot.WPF 是一个开源的数据可视化库,用于在 WPF 应用程序中创建高品质的绘图和图表。它是基于 ScottPlot 库的 WPF 版本,提供了简单易用的 API,使开发人员能够通过简单的代码创建各种类型的图表,如折线图、散点图、柱状图、饼图等。ScottPlot.WPF 还支持交互式功能,可以实现数据点的选中、缩放、平移等操作,以及图表的保存和导出等功能。
ScottPlot - Interactive Plotting Library for .NET


ScottPlot有2个版本,ScottPlot 4和ScottPlot 5。
ScottPlot 5于2024年1月发布,还很新。
2个版本之间的接口不兼容。 本文安装的是ScottPlot 5。
ScottPlot 快速开始
WPF Quickstart (scottplot.net)
通过NuGet安装ScottPlot
NuGet Gallery | ScottPlot.WPF 5.0.21

添加包的命名空间和WpfPlot组件到窗口程序
xmlns:ScottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
<ScottPlot:WpfPlot x:Name="WpfPlot1"/>

在组件中绘制散点图